Append text to file
To append all contents of textfile1.txt to the end of textfile2.txt: $> cat textfile1.txt >> textfile2.txt or to add text directly to the end of the file, you can use: $> echo “TEST” >> testfile.txt
To append all contents of textfile1.txt to the end of textfile2.txt: $> cat textfile1.txt >> textfile2.txt or to add text directly to the end of the file, you can use: $> echo “TEST” >> testfile.txt
To copy a SD-Card to another one including all partitions yo can take the following steps: Find out the device name (f.e.: /dev/mmcblk0): see List, partitioning and format drives or see Get a list of partitions or see Get free disk space and partitions Copy the whole card to an imagefile (Backup): $> sudo dd if=/dev/mmcblk0 of=backup_pi.img bs=4M […]
Sometimes its necessary that your machine gets a static IP-address. For example if you want to run a server or a other service on that machine. On Debian based machines you can do this by: Edit /etc/network/interfaces (f.e.: with nano) auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.88.6 netmask 255.255.255.0 […]
To shred files or partitions securely: $> shred -vun <loops> <File1> <File2> $> shred -vzn <loops> <Device> loop is the count of the loop beginning with 0 (3 means 4-times)!!! You can get the partition table as described in List of partitions or List, partitioning and format drives. If you want to shred a directory recursively, you […]
List all devices: $> sudo fdisk -l That will give you an overview about all your drives like that: Disk /dev/sda: 256.1 GB, 256060514304 bytes 255 heads, 63 sectors/track, 31130 cylinders, total 500118192 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): […]
You can get a sorted list of directory items with a combination of the ls- and sort- command: $> ls -al | sort -nk9,9 With k you can define the column(s) (here 9 till 9) to use for sorting. The parameter n results in a numeric sorting.
$> cat products_delta.xml | xmllint –format – > products_delta_lint.xml  Attention: Don’t use the same file as source and destination! That will result in an empty file!
In the last time I had the problem, that my system became very slow and wasn’t usable anymore. Here are the steps I’ve taken to get rid of this problem: Cleanup old packages in the terminal: $> sudo synaptic got to  Settings -> Preferences -> Files activate the bullet point Delete downloaded files after installation under Temporary […]
Plesk changes the root user name to admin and stores the corresponding password in /etc/psa/.psa.shadow. The value inside this file looks really strange – like an encrypted key or hash. But that’s really your password for the admin user! If you’re lazy – like me – you can login as admin like that: $> mysql -uadmin […]
In Parallels Plesk 9.x, 10.x and 11.x for Linux (in this case CentOS 6.6) there is a bug. You can not authenticate via ssh key or add one f.e. with: $> ssh-copy-id -i .ssh/deploy_rsa.pub user@ask-sheldon.com Thats why you have to do this: Edit ssh deamon configuration: $> sudo nano /etc/ssh/sshd_config Add the following line: AuthorizedKeysFile […]