Skip to content

Instantly share code, notes, and snippets.

wifi-menu
ping -c3 www.google.com
lsblk
cfdisk /dev/sda
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda5
mkswap /dev/sda3
swapon /dev/sda3
@h4n2k
h4n2k / gist:a7726e14c8ce22cb913f
Created March 1, 2016 07:54
fix locale on arch
locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
@h4n2k
h4n2k / gist:c6f6bc88f8e21388c9f8
Created March 3, 2016 15:01
apache folder & file permission
Run the following two commands from your WEBSITE root directory,
it will recursively change all directory permission to 755,
and all file permissions to 644:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
@h4n2k
h4n2k / gist:e070cd16bc48194c7231
Created March 7, 2016 03:46
codeigniter application/config/config.php
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
1. git clone
2. npm install
3. bower install
4. grunt init
5. ionic state reset
6. open platforms/android/res/xml/authenticator.xml
edit
android:accountType="@string/aam_account_type"
@h4n2k
h4n2k / gist:b47a963758de1ef9748476a329753095
Created April 21, 2016 04:59
Composer in Codeigniter prevents MY_ controllers from loading
First, remove this from index.php (the Phil Sturgeon bit):
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( APPPATH . 'core/'. $class . EXT );
}
}
Then, add the following to index.php, right before the "LOAD THE BOOTSTRAP FILE" bit. This is the composer autoload.
db.copyDatabase(<from_db>, <to_db>, <from_hostname>, <username>, <password>);
db.banner.update({}, {$rename: {'imageUrl': 'imgUrl'}}, {multi:true});
@h4n2k
h4n2k / gist:b2fad218f4cfbe4ae47ce1166a50fffd
Last active August 8, 2016 15:15
OSX El Capitan yo-angular
brew install ruby
sudo gem update --system
sudo gem install compass
npm install -g yo
npm install -g generator-angular
npm install -g generator-karma
@h4n2k
h4n2k / gist:6b09048298c9757e085fbe3b3bd95f1b
Created September 7, 2016 15:35
shortcut launch Sublime Text from the command-line
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl