Skip to content

Instantly share code, notes, and snippets.

View weblogix's full-sized avatar

Randy weblogix

View GitHub Profile
@weblogix
weblogix / zsh_install.md
Last active September 26, 2017 16:05
[Install zsh on Mac] #zsh #shell

Install zsh and zsh-completions using Homebrew:

$ brew install zsh zsh-completions

User zsh from brew

$ sudo dscl . -create /Users/$USER UserShell /usr/local/bin/zsh
@weblogix
weblogix / webfont.md
Created September 6, 2017 12:18
[Web font] Snippet for using Web fonts #webfonts
@font-face {
  font-family: 'HelveticaNeueLT';
  src: url("fonts/HelveticaNeueLTPro-Bd.eot");  /* IE8 */
  src: url("fonts/HelveticaNeueLTPro-Bd.eot?#iefix") format('embedded-opentype'),  /* IE9 */
    url("fonts/HelveticaNeueLTPro-Bd.woff2") format("woff2"), /* Chrome, Firefox */
    url("fonts/HelveticaNeueLTPro-Bd.woff") format("woff"),  /* Chrome, Firefox, Safari, IE9 */
    url("fonts/HelveticaNeueLTPro-Bd.ttf") format("truetype"), /* Chrome, Firefox, IE9 */
    url("fonts/HelveticaNeueLTPro-Bd.svg#HelveticaNeueLTPro-Bd") format("svg"); /* Safari */
  font-weight: 700;
@weblogix
weblogix / mysql_cheetsheet.md
Created September 5, 2017 15:15
[MySQL Cheetsheet] #mysql #mariadb

Exporting a Compressed MySQL Dump

mysqldump -u {user} -p {database} | gzip > {database}.sql.gz

Importing a Compressed MySQL Dump

gzip -dc < {database}.sql.gz | mysql -u {user} -p {database}
@weblogix
weblogix / docker-cheatsheet-troubleshooting.md
Last active June 30, 2018 14:36
[Docker cheetsheat] List of common docker commands #docker #cheatsheet

Docker is slow to resolve network

Add to /etc/hosts

127.0.0.1 localunixsocket.local
@weblogix
weblogix / syncFolderDate.sh
Last active August 29, 2017 02:46
[File date sync] Sync's the file dates between 2 folders with the same files #sync #script
#!/bin/bash
SOURCE_DIR=$1
DESTINATION_DIR=$2
find "$SOURCE_DIR" -print | while read filename; do
FILE_NAME="$(basename "$filename")"
SOURCE_PATH="$SOURCE_DIR/$FILE_NAME"
DESTINATION_PATH="$DESTINATION_DIR/$FILE_NAME"
@weblogix
weblogix / .bash_profile
Last active March 29, 2020 06:40
[Mac Power Management] Shortcuts for managing power management shortcuts on your mac #mac #osx #shortcuts
http://blog.taylormcgann.com/2012/07/05/hibernate-from-terminal/
alias hibernate='sudo pmset -a hibernatemode 25'
alias sleep='sudo pmset -a hibernatemode 0'
alias safesleep='sudo pmset -a hibernatemode 3'
alias smartsleep='sudo pmset -a hibernatemode 2'
@weblogix
weblogix / .htaccess - SSL redirect
Last active September 10, 2017 04:48
[Apache htaccess examples] htaccess rules #htaccess #apache
# Source: https://really-simple-ssl.com/knowledge-base/manually-insert-htaccess-redirect-http-to-https/
If you see #SERVER-HTTPS-ON# (on), add
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
If you see #SERVER-HTTPS-ON# (1), add
@weblogix
weblogix / 1. Upgrade PHP on CentOS 7 with yum-replace plugin
Last active February 2, 2020 07:29
Upgrade PHP on CentOS 7 with yum-replace plugin
# Install the IUS repository
$ wget https://centos7.iuscommunity.org/ius-release.rpm
$ sudo rpm -Uvh ius-release*.rpm
#https://askubuntu.com/questions/909691/how-to-install-docker-on-ubuntu-17-04
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-zesty testing'
apt-get update
apt-cache policy docker-engine
@weblogix
weblogix / readme.md
Last active September 10, 2017 04:48
OpenSSL - How to generate a self-signed certificate in non interactive mode #openssl