I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
if ufw is not installed by default be sure to install it first.
| #!/bin/sh | |
| # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
| # CREATE block and create them in separate commands _after_ all the INSERTs. | |
| # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
| # The mysqldump file is traversed only once. | |
| # Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
| # Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
| camera = {} | |
| camera._x = 0 | |
| camera._y = 0 | |
| camera.scaleX = 1 | |
| camera.scaleY = 1 | |
| camera.rotation = 0 | |
| function camera:set() | |
| love.graphics.push() | |
| love.graphics.rotate(-self.rotation) |
| #include <stdio.h> | |
| /* count digits, white space, others */ | |
| int main() | |
| { | |
| int c, i, nwhite, nother; | |
| int ndigit[10]; | |
| nwhite = nother = 0; | |
| for (i = 0; i < 10; ++i) | |
| ndigit[i] = 0; | |
| while ((c = getchar()) != EOF) |
| add_action( 'woocommerce_thankyou', 'my_custom_tracking' ); | |
| function my_custom_tracking( $order_id ) { | |
| // Lets grab the order | |
| $order = wc_get_order( $order_id ); | |
| /** | |
| * Put your tracking code here | |
| * You can get the order total etc e.g. $order->get_total(); |
| #!/bin/bash | |
| REPO=NAME_HERE | |
| # Dir paths on remote server | |
| # These are associated with branches within a git project | |
| LIVE_BRANCH="master" | |
| LIVE="git@host:/var/www/live/" | |
| STAGE_BRANCH="develop" | |
| STAGE="git@host:/var/www/stage/" |
| -- returns nil if there's no movement | |
| function getDirection() | |
| local xAxis = input.axisDown("left", "right") | |
| local yAxis = input.axisDown("up", "down") | |
| local xAngle = xAxis == 1 and 0 or (xAxis == -1 and math.tau / 2 or nil) | |
| local yAngle = yAxis == 1 and math.tau / 4 or (yAxis == -1 and math.tau * 0.75 or nil) | |
| if xAngle and yAngle then | |
| -- x = 1, y = -1 is a special case the doesn't fit; not sure what I can do about it other than this: | |
| if xAxis == 1 and yAxis == -1 then return yAngle + math.tau / 8 end |
| sudo apt-get install ssl-cert | |
| sudo make-ssl-cert generate-default-snakeoil | |
| sudo usermod --append --groups ssl-cert yyuu | |
| ls -l /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/ssl/private/ssl-cert-snakeoil.key |
| # Basic Strongswan ikev2 server setup | |
| * paltform: atlantic.net ubuntu 14.04 x64 | |
| * the commands below are run with root account | |
| ## Strongswan | |
| ``` | |
| apt-get install strongswan | |
| apt-get install iptables iptables-persistent | |
| ``` |