Skip to content

Instantly share code, notes, and snippets.

View iryston's full-sized avatar

Igor R. Plity iryston

View GitHub Profile
@iryston
iryston / gist:16d93bc9115ad23a719bcd06f9c6af93
Created February 24, 2017 18:26 — forked from opi/gist:5144388
Implements hook_language_switch_links_alter() - Alter language switch links.
<?php
/**
* Implements hook_language_switch_links_alter().
*/
function mymodule_language_switch_links_alter(array &$links, $type, $path) {
global $language;
if ($type == LANGUAGE_TYPE_INTERFACE && isset($links[$language->language])) {
foreach ($links as $langcode => &$link) {
// If no translation exists, redirect to frontpage
@iryston
iryston / drop-mysql-tables.sh
Created February 6, 2017 08:57 — forked from ticean/drop-mysql-tables.sh
Shell script to drop all tables from MySQL.
#!/bin/bash
# A shell script to delete / drop all tables from MySQL database.
# Usage: ./script user password dbnane
# Usage: ./script user password dbnane server-ip
# Usage: ./script user password dbnane mysql.nixcraft.in
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
@iryston
iryston / DoIt.md
Created January 2, 2017 01:56 — forked from scotthorn/DoIt.md
Setting up Drupal 7 on AWS Ubuntu 14.04 with Nginx, Memcache, and Varnish
@iryston
iryston / gist:9d560d0effe7625e192e
Last active August 29, 2015 14:27 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
# tmux installation steps for Ubuntu 14.04 (Trusty Tahr)
sudo apt-get update
sudo apt-get install -y python-software-properties software-properties-common
sudo add-apt-repository -y ppa:pi-rho/dev
sudo apt-get update
sudo apt-get install -y tmux=1.9a-1~ppa1~t
tmux -V
# On Ubuntu 12.04 (Precise Pangolin), step 5 would be: sudo apt-get install -y tmux=1.9a-1~ppa1~p
# On Ubuntu 13.10 (Saucy Salamander), step 5 would be: sudo apt-get install -y tmux=1.9a-1~ppa1~s