Convenient functions and aliases to add to your ~/.bash_rc or ~/.bash_profile files to make your life in the terminal better.
alias gitlog='git log --all --graph --oneline --pretty --decorate'
If you're on a mac and want md5sum command to behave similarly to linux:
alias md5sum='md5 -r'
Are you tired of dealing with filenaming? Want to simply have the most meaningful possible filename...
]]>var dostuff = function( arg ) { do stuff };
can be written as
var dostuff = ( arg ) => { do stuff };
We nolonger use var
, we now use let
. Meanwhile, const
is used for constants that can NEVER be changed.
Rejoice, it is now much easier to concatenate strings and variables!
//Old form
console.log("Hello " + name + ", the total is " + ( a + b ) + ".");
//ES2015 (ES6) Javascript, Template...
]]>
Creating a child theme in Grav CMS is a truly beautiful, simple process.
1.. Create a new folder: user/themes/mytheme
to house your new theme.
2.. Create a new theme YAML file: /user/themes/mytheme/mytheme.yaml
with the following content:
streams:
schemes:
theme:
type: ReadOnlyStream
prefixes:
'':
- user/themes/mytheme
- user/themes/antimatter
3.. Change your default theme to use your new mytheme by editing t...
]]>NOTE: If certificate errors prevent you from connecting to a trusted server, you can disable these errors permanently: echo “set ssl:verify-certificate false” >> ~/.lftprc
To connect to a server and mirror it to a local directory:
lftp productionserver.com
user sangpo@productionserver.com
ls
cd public_html
lcd /var/www/devsite/
mirror
To mirror local directory to remote: mirror -R
To exc...
]]>Unknown collation: 'utf8mb4_unicode_520_ci'
.
It turns out the CentOS 7 repo only offers MariaDB version 5.5, meanwhile www.mariadb.org currently offers version 10.1 and also states that utf8mb4_unicode_520_ci is a supported collation...sudo echo “
#MariaDB 10.1 CentOS repository list - created 2016-08-19 03:23 UTC
#http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = ht...
]]>
Warning: this completely deletes the existing database!
NOTE: The create database command character set and collation are simply set to match whatever was used on production...
]]>I ran into an issue using the SimpleSearch plugin in which no results would appear.
Via web admin in Plugins --> SimpleSearch --> Filters, I changed the the default filters "Blog" to blank, since we don't want to exclude anything from the search. However it...
]]>adduser myuser
passwd myuser
gpasswd -a myuser wheel
su - myuser
mkdir .ssh
chmod 700 .ssh
vi .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
Made the following modifications to /etc/ssh/sshd_config
:
Port 2222
PermitRootLogin no
MaxAuthTries 6
MaxSessions 10
PubkeyAuthentication yes
PasswordAuthentication no
Then restart the service: systemctl reload sshd
yum install vsftpd
Make the following modifications to the default /etc/vsftp...