Skip to main content

Posts

Set up default php cli version

* To select a default php cli version Prior to choose a version, make sure that you installed the version e.g. sudo update-alternatives --set php /usr/bin/php7.2 sudo update-alternatives --set php /usr/bin/php7.1 sudo update-alternatives --set php /usr/bin/php7.0
Recent posts

Preferred gnome termial style

[/] foreground-color='rgb(201,201,201)' cjk-utf8-ambiguous-width='narrow' rewrap-on-resize=true palette=['rgb(0,0,0)', 'rgb(234,101,44)', 'rgb(123,211,101)', 'rgb(232,195,120)', 'rgb(52,101,164)', 'rgb(117,80,123)', 'rgb(7,201,203)', 'rgb(211,215,207)', 'rgb(184,130,255)', 'rgb(171,255,45)', 'rgb(180,235,116)', 'rgb(211,186,98)', 'rgb(121,206,232)', 'rgb(241,127,203)', 'rgb(213,213,213)', 'rgb(199,199,199)'] word-char-exceptions=@ms '-,.;/?%&#_=+@~·:' default-size-columns=133 default-size-rows=40 cursor-shape='underline' scroll-on-output=true backspace-binding='auto' use-system-font=false use-transparent-background=false use-theme-colors=false font='Ubuntu Mono 12' use-theme-transparency=true allow-bold=true scrollback-unlimited=true bold-color-same-as-fg=true background-color='rgb(59,59,59)' backgrou...

gnome terminal profile

#!/bin/bash #======================================================================================================================= # Export and import Gnome Terminal profiles #======================================================================================================================= # Displays usage info and exits # Parameters: #   1 - error message (if any) usage() {   [ -z "$1" ] || echo "ERROR: $1" >&2   echo "Usage: $0 import|export <filename>" >&2   exit 1 } # Prints a failure message and exits # Parameters: #   1 - message err() {   echo "ERROR: $1" >&2   exit 2 } #----------------------------------------------------------------------------------------------------------------------- # Check variables mode="$1" filename="$2" [[ -z "$mode"     ]] && usage "No mode specified" [[ -z "$filename" ]] && usage "No filename specified"...

[CraftCMS] Country list for DropDown

How to import it 1. Create a field 2. Choose Dropdown for Field Type 3. Create one entry in option 4. Find the record with the option value in [craft_]fields table - [craft_] suffix depends on user setting 5. Overwrite the setting value with the following {"options":[{"label":"New Zealand","value":"newZealand","default":""},{"label":"Afghanistan","value":"afghanistan","default":""},{"label":"Albania","value":"albania","default":""},{"label":"Algeria","value":"algeria","default":""},{"label":"American Samoa","value":"americanSamoa","default":""},{"label":"Andorra","value":"andorra","default":""},{"label":...

Chrome Proxy Set up

1. sudo vim /usr/share/applications/google-chrome.desktop 2. Add --proxy-server="ip:port" at the end of each google-chrome-stable command e.g. Exec=/usr/bin/google-chrome-stable --proxy-server="ip:port"

[psql] Command Equivalents in Postgres Coming From Mysql

Mysql Postgres Description  mysqldump  pg_dumpall  pg_dumpall is designed to dump all of the databases and calls pg_dump to do it. It can also be used to dump global values like roles and tablespaces.Example with mysql: mysqldump –all-databases > /path/to/file.sql Example with postgres: pg_dumpall > /path/to/file.sql mysqldump pg_dump pg_dump is used for dumping individual databases.Example with mysql: mysqldump mydatabase > /path/to/file.sql Example with postgres: pg_dump mydatabase > /path/to/file.sql n/a pg_restore pg_dump is capable of dumping to multiple formats with the -F option.  The default option is as a raw sql file.  If you wanted to dump as postgres’s “custom” format, you could add -Fc as options before the database name when using pg_dump.pg_restore is designed to restore from output files generated in this fashion. I am not aware of a mysql equivalent for pg_restore, but it reminds me more of a restore of a binary type file t...