Skip to content

Instantly share code, notes, and snippets.

View gist:5972486

Install Git 1.8.1.2 from source on CentOS 6.3

These are the Terminal commands I recently used (Feb 2013) to install Git 1.8.1.2 from source on CentOS 6.3. I ran this in a VirtualBox VM after a fresh install from the ISO.

You mileage will vary as the yum packages are updated over time. The yum install line below should include all the dependencies, at least it did for me. Eventually yum install git will include 1.8.x but until then I hope this helps.

cd ~/Downloads
su
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
@missdeer
missdeer / update-chrome.bat
Created Aug 21, 2013
save the code as update-chrome.bat, place a wget.exe with update-chrome.bat, for China Mainland people, please set a hosts item for commondatastorage.googleapis.com.
View update-chrome.bat
del LAST_CHANGE
wget --no-check-certificate https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win/LAST_CHANGE
for /f %%i in (LAST_CHANGE) do (
set version=%%i
)
echo %version%
del chrome-win32.zip
wget --no-check-certificate https://commondatastorage.googleapis.com/chromium-browser-snapshots/Win/%version%/chrome-win32.zip
"D:\Program Files\7-Zip\7z.exe" x -y %~dp0chrome-win32.zip
del chrome-win32.zip
@missdeer
missdeer / cn_nytimes_to_instapaper.sh
Created Oct 17, 2013
extract hyper links from http://cn.nytimes.com/ homepage and save to Instapaper
View cn_nytimes_to_instapaper.sh
curl --socks5 127.0.0.1:7070 http://cn.nytimes.com/ 2>/dev/null | grep -o '<a href="[^"]\+" title="[^"]\+"' | sed -e 's/<a href="//g' | sed -e 's/" title="/ /g' | sed -e 's/"//g' | while read url title
do if [[ ${url:0:5} != "http:" ]]
then
url="http://cn.nytimes.com$url"
fi
echo $url | mail -s "$title" readlater.xxxx@instapaper.com
done
@missdeer
missdeer / isPrime.js
Created Nov 11, 2013
isPrime.js, regexp magic
View isPrime.js
function isPrime(i) {
var ones = "";
while(--i >= 0) ones += "1";
return !/^1?$|^(11+?)\1+$/.test(ones);
}
View boost.sh
#===============================================================================
# Filename: boost.sh
# Author: Pete Goodliffe
# Copyright: (c) Copyright 2009 Pete Goodliffe
# Licence: Please feel free to use this, with attribution
# Modified version
#===============================================================================
#
# Builds a Boost framework for the iPhone.
# Creates a set of universal libraries that can be used on an iPhone and in the
View gist:a2ab151b734d2ecf8510
183.60.243.233 - 199.91.73.17 - - [17/Jun/2014:22:36:43 +0800] "GET / HTTP/1.1" 200 13888 "-" "-""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:37:16 +0800] "GET /robots.txt HTTP/1.1" 200 425 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:37:44 +0800] "GET / HTTP/1.1" 200 13888 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:38:15 +0800] "GET / HTTP/1.1" 200 13888 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 - 199.91.73.17 - - [17/Jun/2014:22:38:46 +0800] "GET /login HTTP/1.1" 200 9953 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SV1; QQDownload 732; .NET4.0C; .NET4.0E; 360SE)""-"
183.60.243.233, 10.1.1.1 -
View ssl_smtp_example.go
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
View gist:5d28cb6cb44f6f7ce6c0
{
"recipients": [
0x01,
0x02
],
"body": "hello",
"type": 1
}
View gist:d9f8ba521faf5b74dc92
func main() {
python_readability := &controllers.PythonReadabilityController{}
beego.Router("/*", python_readability, "get:Get")
........
}
func (u *PythonReadabilityController) Get() {
url = u.GetString(":splat")
if len(url) != 0 {
url = strings.Replace(url, "http:/", "http://", 1)
You can’t perform that action at this time.