This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Turn on password authentication | |
sudo sed -i ‘s/^PasswordAuthentication.*/PasswordAuthentication yes/’ /etc/ssh/sshd_config | |
# Reload SSH/SSHd configuration | |
sudo service ssh reload | |
# Set a password for the ubuntu (for ubuntu instances, otherwise use the default username for that instance type) | |
sudo passwd ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to add a new user (fill in the details as prompted) | |
sudo adduser username | |
# grant root priviledges to a user | |
sudo /usr/sbin/visudo | |
# add this after the line that says "root ALL=(ALL:ALL) ALL" | |
username ALL=(ALL:ALL) ALL | |
# if you want to change the password later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" execute pathogen plugins | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
set nocompatible " Disable vi-compatibility | |
set t_Co=256 | |
colorscheme xoria256 | |
set guifont=menlo\ for\ powerline:h16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=UTF-8 | |
import argparse | |
import math | |
import subprocess | |
import sys | |
def main(argv): | |
parser = argparse.ArgumentParser(description='Display current battery capacity') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before compiling, install nginx-naxsi package. This package is compiled with the option --without-http_uwsgi_module. | |
Uninstall it but without purge for keeping configuration files. | |
Check https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source | |
---------- OLD ---------- | |
543 wget https://dl.google.com/dl/page-speed/psol/1.6.29.5.tar.gz | |
->> https://github.com/pagespeed/ngx_pagespeed <<-- | |
549 wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz | |
553 wget http://nginx.org/download/nginx-1.5.8.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('ROUTER_DEFAULT_CONTROLLER', 'home'); | |
define('ROUTER_DEFAULT_ACTION', 'index'); | |
class Router { | |
public $request_uri; | |
public $routes; | |
public $controller, $controller_name; | |
public $action, $id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* * ** | |
* | |
* This script converts an existing MySQL database to migrations in Laravel 4. | |
* | |
* 1. Place this file inside app/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* * ** | |
* | |
* This script converts an existing MySQL database to migrations in Laravel 4. | |
* | |
* 1. Place this file inside app/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Bgy Library | |
* | |
* LICENSE | |
* | |
* This program is free software. It comes without any warranty, to | |
* the extent permitted by applicable law. You can redistribute it | |
* and/or modify it under the terms of the Do What The Fuck You Want | |
* To Public License, Version 2, as published by Sam Hocevar. See |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
*/ | |
(function() { |
OlderNewer