Posts Tagged ‘Linux & Unix’

How to Install New Icons and Cursors (Linux Mint)

Wednesday, October 5, 2011 posted by CSch

The way to add new icons and cursors is simple yet not really obvious in Linux Mint. To add new cursors, download any from a webside that provides these (as this), and drag and drop the package file onto the theme preferences of your Control Center:

To add new icons, just download and extract them into /usr/share/icons as root. Afterwards they are available in the Appearance section of the Control Center.

Copy and Paste Multiple Entries (Ubuntu Linux)

Thursday, September 29, 2011 posted by CSch

To be able to copy and paste multiple entries with Control + C and Control + V there is an applet for the GNOME desktop panel called Glipper which is a clipboard manager and is available in the default Ubuntu repositories. If it does not show up in your list of applets after installation, restart your system and it should be available. Its menu is accessible over the panel icon and the key combination which is configured in the Preferences menu (Ctrl+Alt+C by default). The top entry is the one that will be pasted on Ctrl+V. To change it, just select another one.

In Preferences, you can also configure on what actions selections should be copied into the clipboard, if they should be remembered on system restart and how many entries should be remembered.

Quicklink Current Files on the Desktop Panel (Ubuntu Linux)

Thursday, September 29, 2011 posted by CSch

There is a desktop panel applet for Ubuntu Linux and its derivatives that is able to store files and folders within a dropdown window accessible from a tiny icon on the panel bar called Topshelf. It is available in the default Ubuntu repositories.

It receives content by just dragging and dropping it into its window which opens upon clicking the topshelf icon. This way you do not have to browse long ways through the file system to find the files you are working on regularly but have easy access on them by quicklinking.

Change Default Application to Open Files (Linux Mint)

Tuesday, September 27, 2011 posted by CSch

The default application is the one you open a file with on doubleclick. In some cases installed programs automatically turn themselves into the default application for files you were happy with, which you might want to change. To do that, rightclick a file of the chosen format and choose Open With… -> Other Application or Open With Other Application:

On the window that opens, choose an application or command and check the Remember this application for “…” files checkbox to apply your selection for all files of the same format:

Hit Open afterwards.

If a linux system user is able to login on the shell or with SSH depends on its shell setting in /etc/passwd. If you want to prevent that a certain user is able to login, then set the shell either to /bin/false or /sbin/nologin.

Example for Debian and Ubuntu Linux for the user with the username “otheruser”:

usermod -s /bin/false otheruser

For Redhat, Fedora or CentOS use /sbin/nologin:

usermod -s /sbin/nologin otheruser

Warning: Do not set the shell for the root user to /bin/false or /sbin/nologin!

How to convert filenames or text to lowercase on the shell

Wednesday, September 2, 2009 posted by admin

There is no simple tolower command on the bash, but with a little shell script you can convert uppercase characters to lowercase. The script uses the tr command internally for converting the chars.

Create a shell script with the name tolower:

vi /usr/local/bin/tolower

and enter the following content:

#!/bin/sh
echo $1 | tr ‘[:upper:]‘ ‘[:lower:]‘

Then make the script executable:

chmod +x /usr/local/bin/tolower

An test it by executing this command on the shell:

tolower “Thats a Test”

will convert the string to lowercase and show the result on the shell:

thats a test

Backup and restore mysql databases on the shell

Thursday, August 13, 2009 posted by admin

One way to create a backup of a mysql database on the shell is to use the mysqldump command. Mysqldump creates a dump of the database in form of sql commands.

Backup

mysqldump -u root -p mydatabase > /tmp/backup_mydatabase.sql

This command creates a backup of the database with the name “mydatabase” in the file /tmp/backup_mydatabase.sql

Restore

To restore the backup, use the command:

mysql -u root -p mydatabase < /tmp/backup_mydatabase.sql

To turn on verbose logging (e.g. to debug FTP connection or authentication problems) inĀ  pure-ftpd FTP server on Debian and Ubuntu Linux, execute the following command as root user in the shell:

echo ‘yes’ > /etc/pure-ftpd/conf/VerboseLog

and then restart pure-ftpd

/etc/init.d/pure-ftpd-mysql restart

The debug output will be logged to syslog. To view the log content, execute:

tail -n 100 /var/log/syslog

To disable verbose logging, execute these commands:

rm -f /etc/pure-ftpd/conf/VerboseLog
/etc/init.d/pure-ftpd-mysql restart