Snippets

CSS: Height equal to dynamic width

There is a way using CSS! If you set your width depending on the parent container you can set the…

2 years ago

bash: Find text in files in subdirectories recursively

grep -rnw '/path/to/somewhere/' -e 'pattern' -r or -R is recursive, -n is line number, and -w stands for match the whole word. -l (lower-case L) can…

7 years ago

Remove duplicate lines from text file

This snippet will remove duplicate lines from text file: awk '!seen[$0]++' filename It will display the results on screen. If…

8 years ago

phpMyAdmin: Different SQL file name on each export

Easiest way to export your database is through phpMyAdmin. With few clicks you can get database export and then use…

10 years ago

Restart Apache automatically

Put this code into a .sh file, add executable permissions to it and add it to root user’s crontab. See…

10 years ago

Restart MySQL automaticaly

Put this code into a .sh file, add executable permissions to it and add it to root user's crontab. See…

10 years ago

How to add Facebook application as a page tab

Facebook has a somehow hidden way for addding applications as page tab. To do that, you need to enter the…

11 years ago

Creating symlink in Unix

ln -s /path/to/file /path/to/symlink

11 years ago

Find php.ini location of PHP CLI

$ php -i |grep php\.ini Also: $ php --ini This will also show all extra *.ini files loaded (usually hanging…

11 years ago

Delete All .svn Directories Recursively

Execute in the directory you want to purge .svn files from find . -type d -name .svn -exec rm -rf…

11 years ago