open ~/.bashrc in text editor and uncomment line:
#force_color_prompt=yes
to be:
force_color_prompt=yes
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'dbpassword' WITH GRANT OPTION; | |
| FLUSH PRIVILEGES; |
| <IfModule mod_ssl.c> | |
| <VirtualHost *:443> | |
| ServerAdmin webmaster@localhost | |
| ServerName domain.com.au | |
| DocumentRoot /path-to-www | |
| SuexecUserGroup web-data web-data | |
| #LogLevel info ssl:warn | |
| ErrorLog ${APACHE_LOG_DIR}/error-ssl-html.log | |
| CustomLog ${APACHE_LOG_DIR}/access-ssl-html.log combined |
| select count(id), join_datetime from customers | |
| where status > 0 | |
| group by DATE(join_datetime) | |
| order by join_datetime desc | |
| select count(id), join_datetime from customers | |
| where status > 0 | |
| group by MONTH(join_datetime) | |
| order by join_datetime desc |
| [mysqld] | |
| skip-log-bin | |
| innodb_file_per_table=1 | |
| expire_logs_days = 1 | |
| max_binlog_size = 10M | |
| #use following detail to clean everything about bin log | |
| #PURGE BINARY LOGS TO 'mysql-bin.000029'; | |
| #RESET MASTER; |
| <?php | |
| // ref: http://stackoverflow.com/questions/356128/can-i-extend-a-class-using-more-than-1-class-in-php | |
| class B { | |
| public function method_from_b($s) { | |
| echo $s; | |
| } | |
| } | |
| class C { | |
| public function method_from_c($s) { |
| sudo service beanstalkd stop | |
| sudo service supervisor stop | |
| sudo service memcached stop | |
| sudo service hhvm stop |
| #download | |
| youtube-dl -F <URL> # see all format | |
| youtube-dl -f <format> <URL> # download format | |
| # DASH decode | |
| ffmpeg -i input.m4a -vn -acodec copy output.m4a # Solve: writing DASH m4a. Only some players support this container. Install ffmpeg or avconv to fix this automatically. | |
| #mp3 | |
| ffmpeg -codecs help | grep 'mp3' # check mp3 codecs | |
| ffmpeg -i input.m4a -acodec libmp3lame -ab 128k output.mp3 |
| # Exception Handling | |
| def spam(divideBy): | |
| return 42 / divideBy | |
| try: | |
| print(spam(2)) | |
| print(spam(12)) | |
| print(spam(0)) | |
| print(spam(1)) | |
| except ZeroDivisionError: |
open ~/.bashrc in text editor and uncomment line:
#force_color_prompt=yes
to be:
force_color_prompt=yes
open ~/.bashrc in text editor and uncomment line:
#force_color_prompt=yes
to be:
force_color_prompt=yes