Cleanup Ubuntu

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 […]

MySQL root-user and password under Plesk Parallels

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 […]

Export image file statistics to csv

To get a CSV export of all image files with name, last access date, last change date, last modification date and filesize in byte in a folder including all subfolders, you can use this linux command: $> find . -regex “.*\.\(jpg\|gif\|png\|jpeg\)” -type f -printf “%p,%AY-%Am-%AdT%AT,%CY-%Cm-%CdT%CT,%TY-%Tm-%TdT%TT,%s\n” > filestat_data_20141201.csv or separated by tabs: $> find . -regex […]

Get a list of partitions

To get a list of your currently mounted partitions: $> sudo blkid -o list -w /dev/null Result device fs_type label mount point UUID —————————————————————————————————————————————————————————————- /dev/sda1 ext4 / 79012107-aeb7-4f72-95ca-a9ffaa9f502b /dev/sda5 swap <swap> 34e355d7-dd93-45f7-9696-02c6d4ebb8e8 /dev/sdb1 ntfs /media/7EEFE87C38D4D6CF 7EEFE87C38D4D6CF  

Linux – Get information about installed memory

On Ubuntu you’ll get the all memory (RAM) information with: $> cat /proc/meminfo Example output: MemTotal: 32829172 kB MemFree: 27614092 kB Buffers: 350460 kB Cached: 2232256 kB SwapCached: 0 kB Active: 2629788 kB Inactive: 1925788 kB Active(anon): 1989372 kB Inactive(anon): 443036 kB Active(file): 640416 kB Inactive(file): 1482752 kB Unevictable: 6056 kB Mlocked: 6056 kB SwapTotal: 0 […]

Copy system image to SD-Card

To get a bootable SD-Card from an image file (*.img) you can run teh dd command like tahe $> sudo dd if=/home/bravehartk2/Dropbox/Elektrotechnik/Banana/Raspbian_For_BananaPi_v3_0.img of=/dev/mmcblk0 bs=1M && sync This creates the necessary boot bartition and system partition on device  /dev/mmcblk0. To get a list of your mounted partitions look here.  

Associative arrays (hash, dictionary) on bash

This is how to create associative arrays (hash, dictionary) on bash: #!/bin/bash if [ “$1” == “help” ] then echo “Help”; echo “USAGE:”; echo “========”; echo “purge_landingpage_varnish.sh LIVE|STAGE”; exit 0; elif [ $1 ] then DOMAINS[‘LIVE’]=”www.ask-sheldon.com”; DOMAINS[‘STAGE’]=”stage.ask-sheldon.com; REQUEST_DOMAIN=””; if [ “$1” == “LIVE” -o “$1” == “STAGE” ] then REQUEST_DOMAIN=${DOMAINS[“$1”]}; else echo “You have to give […]