This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script will output dumps for all databases using seperate files | |
| # Derived from this post: http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/ | |
| USER="root" | |
| PASSWORD="SnM1073k" | |
| HOST="localhost" | |
| MYSQL="$(which mysql)" | |
| MYSQLDUMP="$(which mysqldump)" | |
| OUTPUT_DIR="/backups/files" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Allow a command to continue execution after logout | |
| nohup mycommand & | |
| # Display one particular line from a file | |
| gzip -dc mytarball.tar.gz | tar xvf - | |
| # Display current runlevel | |
| who -r | |
| # Split lines of text into n-char lines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FF000000 | |
| FFFFFFFF | |
| FFFF0000 | |
| FF00FF00 | |
| FF0000FF | |
| FFFFFF00 | |
| FFFF00FF | |
| FF00FFFF | |
| FF800000 | |
| FF008000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Add eio so file in php.ini | |
| var_dump(extension_loaded('eio')); | |
| // sudo pecl install eio-1.2.5 | |
| // add extension in php.ini extension=eio.so | |
| /* Is called when eio_nop() finished */ | |
| function my_nop_cb($data, $result) { | |
| sleep(1); | |
| echo "my_nop ", $data, "\n"; | |
| sleep(2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $pid = pcntl_fork(); | |
| if ($pid == -1) { | |
| die("could not fork"); | |
| } else if ($pid) { | |
| exit(); // we are the parent | |
| } else { | |
| // we are the child | |
| } | |
| if (posix_setsid() == -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| $num_to_char = array( | |
| '27' => "1", | |
| '28' => "2", | |
| '29' => "3", | |
| '30' => "4", | |
| '31' => "5", | |
| '32' => "6", | |
| '33' => "7", | |
| '34' => "8", |
NewerOlder