#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
#First released as C++ program by Hiroyuki Tsutsumi as part of the free software suite “Beer” | |
#I thought porting it to Python could be both a challenge and useful | |
from sys import argv, exit, getsizeof | |
from struct import pack_into, unpack_from | |
def ceil4(n): |
#!/bin/bash | |
cd /usr/local/src | |
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz | |
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz | |
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2 | |
gcc start-stop-daemon.c -o start-stop-daemon | |
cp start-stop-daemon /usr/sbin/ |
#!/bin/bash | |
set -e | |
if [ $# -eq 0 ]; then | |
echo "USAGE: $0 plugin1 plugin2 ..." | |
exit 1 | |
fi | |
plugin_dir=/var/lib/jenkins/plugins |
To install tcptraceroute on Debian/Ubuntu:
$ sudo apt-get install tcptraceroute
To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:
$ sudo yum install tcptraceroute
//! moment-timezone.js | |
//! version : 0.3.0 | |
//! author : Tim Wood | |
//! license : MIT | |
//! github.com/moment/moment-timezone | |
(function (root, factory) { | |
"use strict"; | |
/*global define*/ |
var fs = require('fs'); | |
var path = require('path'); | |
var userPath = path.resolve(process.argv[2] || './'); | |
var codeStyle = process.argv[3] || 'js'; | |
explorer(userPath); | |
function explorer(path) { | |
fs.stat(path, function(err, stat) { | |
if (err) { |
import hashlib | |
import base64 | |
hash = "05153F611B337A378F73F0D32D2C16D362D06BA5" | |
# print type(hash) | |
# print hash | |
sa1 = hash[:2] | |
sa2 = hash[-2:] |
curl
to get the JSON response for the latest releasegrep
to find the line containing file URLcut
and tr
to extract the URLwget
to download itcurl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \