Skip to content

Instantly share code, notes, and snippets.

View kelsS's full-sized avatar
🍵

Kelsey S. kelsS

🍵
View GitHub Profile
@kelsS
kelsS / install-drush-convert-cli.md
Last active July 26, 2017 13:07
Install Drush Database UTF8MB4 Converter
drush @none dl utf8mb4_convert-7.x
drush cache-clear drush
@kelsS
kelsS / convert-db.md
Last active July 26, 2017 13:08
Convert Drupal DB to UTF8MB4 to support emojis, etc...
drush vset maintenance_mode 1
drush utf8mb4-convert-databases
drush cc all
@kelsS
kelsS / example-settings.php
Last active July 26, 2017 13:06
Example Drupal Settings.php with UTF8MB4 Database Enabled
$databases['default']['default'] = array(
'driver' => 'mysql',
'database' => 'databasename',
'username' => 'username',
'password' => 'password',
'host' => 'localhost',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
);
@kelsS
kelsS / update-node.txt
Created May 20, 2017 03:10
Update Nodejs
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
*or sudo n latest for latest version*
@kelsS
kelsS / restore.sh
Created May 22, 2017 16:44
Shell script that restores most recent auto removed packages.
echo '#!/bin/bash' > restore.sh
echo sudo apt-get install `grep Remove /var/log/apt/history.log | tail -1 | sed -e 's|Remove: ||g' -e 's|([^)]*)||g' -e 's|:[^ ]* ||g' -e 's|,||g'` >> restore
chmod +x restore
./restore.sh
@kelsS
kelsS / windows-ps-cmd.md
Last active June 19, 2017 14:57
Windows Powershell Commands

Create PS profile if it doesn't exist and add module accross all shell sessions

if (-Not (Test-Path $PROFILE)) { New-Item $PROFILE –Type File –Force }

Add-Content $PROFILE "`nImport-Module posh-docker"

Stop Powershell beeping

net stop beep

@kelsS
kelsS / ampps-mysql-fix.md
Created June 9, 2017 13:16 — forked from irazasyed/ampps-mysql-fix.md
AMPPS MySQL not working, Solution!

AMPPS MySQL not working, Solution!

  1. Open Ampps Application -> MySQL Tab -> Configuration.

  2. In [mysqld] section, add the following line: innodb_force_recovery = 1

  3. Save the file and try starting MySQL

  4. Remove that line which you just added and Save.

@kelsS
kelsS / docker-rm.sh
Last active June 14, 2017 17:51
Shell script that deletes all docker containers and images
#!/bin/bash
# Delete all containers
docker container rm $(docker container ps -a -q)
# Delete all containers even running ones
docker container rm -f $(docker container ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@kelsS
kelsS / docker-for-windows.md
Last active June 19, 2017 16:45
Docker info pertaining to Windows

docker container port container_name

  • Shows what port is exposed to the container

docker container inspect --format

  • Shows the IP address of the container which by default is different from the host IP
  • Using Windows shell you need to replace the single quotes with double quotes
    • i.e.
      • "{{.NetworkSettings.IPAddress}}"
  • docker container inspect --format "{{.NetworkSettings.IPAddress}}" container_name

-p or Publish flag for exposing ports

  • Publishing ports is always in HOST:CONTAINER format
@kelsS
kelsS / jquery-snippets.md
Last active June 14, 2017 18:00
Useful jQuery snippets.