Skip to content

Instantly share code, notes, and snippets.

@linkarys
linkarys / svn-to-git
Last active December 28, 2015 15:29
svn-to-git
# get svn user list
svn log -q svn_repository | grep -e '^r' | awk 'BEGIN {FS = "|" }; {print $2}' | sort | uniq
svn log --xml svn_repository | grep author | sort -u | perl -pe 's/.>(.?)<./$1 = /'
# create file users.txt:
old_username = new_usename <user_email>
# svn to git
git svn clone svn_repository --authors-file=users.txt --no-metadata -s git_fold
# specify reversion
@linkarys
linkarys / git-config
Last active December 28, 2015 13:39
git configure
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false
[color]
ui = auto
[color "branch"]
@linkarys
linkarys / regular-expressions-summary
Created April 30, 2013 02:21
regular expressions: summary
regex{
negated character class:{
[^...]
}
word bundary:{
\b
\<
\>
}
wrod: {
@linkarys
linkarys / directives
Created April 19, 2013 06:39
coldfusion: directives
restart: {
cfusion8: sudo /etc/init.d/cfmx8-cfusion start
cfusion10:{
win: coldfusion.exe restart -console
linux: sudo /opt/coldfusion10/cfusion/bin/coldfusion restart
}
}
install: {
@linkarys
linkarys / ubuntu-directives
Last active December 15, 2015 15:09
ubuntu: directives
Commands:
1. pwd: print working directory
2. ls: list [ -s | -sh | -h]
3. cd {
root: cd /
home: cd or cd ~
up: cd..
back: cd -
}
4. cp: copy [-r]
@linkarys
linkarys / linux-apacheSettings
Last active December 15, 2015 15:09
ubuntu: apache-settings
apache:{
1. syntax test: sudo apachectl configtest / sudo apachectl -t
2. restart: sudo apachectl restart
3. dis/enable site sudo a2[dis | en] site [SITENAME]
4. httpd.conf: ServerName 127.0.1.1
5. hosts: 127.0.0.1 PC_NAME
6. dropbox: ./dropbox-list/dropbox
7. cfusion10: /opt/coldfusion10/cfusion/bin/coldfusion start
8. unzip tar.bz2: tar -jxvf FileName.tar.bz2
9. unzip .tar.gz: tar -zxvf FileName.tat.gz
@linkarys
linkarys / ubuntu-setup.cpp
Last active December 15, 2015 15:08
ubuntu: set up
/*******************************************************************
* author: ryan Yang
* date: 2012.10.5
********************************************************************/
/*=================================================================
Android
===============================================================*/
@linkarys
linkarys / php-connectMysql
Created March 30, 2013 05:26
php: connect mysql
<?php
// Create connection
$con=mysqli_connect("localhost","root","Kit to 0","sunshine");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
} else {
$sql = "SELECT date, sum(total) AS spend
FROM comsumption
@linkarys
linkarys / php-generaterUUID
Created March 30, 2013 05:25
php: generate UUID
function gen_uuid() {
return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
// 32 bits for "time_low"
mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
// 16 bits for "time_mid"
mt_rand( 0, 0xffff ),
// 16 bits for "time_hi_and_version",
// four most significant bits holds version number 4
@linkarys
linkarys / sublime-shortcuts
Created March 30, 2013 04:09
sublime: shortcuts
Search Forward F3
Search Backwards Shift + F3
Select All Matches Alt + F3Searching
Toggle Regular Expressions Alt + R
Toggle Case Sensitivity Alt + C
Toggle Exact Match Alt + W
Find Next Enter
Find Previous Shift + Enter