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
hostname := iris.ParseHost(ctx.HostString()) |
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
curl http://我是.大平台.tw/ |
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
ctx.hostname //koa | |
req.hostname //express |
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/python | |
# -*- coding: utf-8 -*- | |
import sys | |
import pymongo | |
from pymongo import MongoClient | |
from logbook import Logger | |
from bson.objectid import ObjectId |
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/python | |
# -*- coding: utf-8 -*- | |
import sys | |
import pymongo | |
from pymongo import MongoClient | |
from logbook import Logger | |
from bson.objectid import ObjectId |
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
echo "$1" | sudo tee /etc/hostname | |
echo "127.0.0.1 $1" | sudo tee -a /etc/hosts | |
sudo vi /etc/hosts | |
sudo service hostname restart | |
sudo hostname |
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
sudo apt-get -y install zsh git curl | |
sudo chsh -s $(which zsh) $(whoami) | |
curl -L http://install.ohmyz.sh | zsh | |
cd ~/.oh-my-zsh/themes | |
sudo curl -O https://gist.githubusercontent.com/kytu800/0d38f0857821fe95ab72/raw/bfdc12eda9036c459fa990eed970dfbf28da9242/kytu.zsh-theme | |
perl -pi -e 's/robbyrussell/kytu/g' ~/.zshrc |
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
function uuid(){ | |
function s4() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
s4() + '-' + s4() + s4() + s4(); | |
} |
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
import urllib | |
url = 'http://www.dcard.tw/f/mood/p/40873' | |
query = "SELECT share_count, like_count, comment_count, total_count FROM link_stat WHERE url='"+url+"'" | |
print(query) | |
query = urllib.quote(query) | |
print(query) |
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
sudo apt-get -y install zsh | |
sudo chsh -s $(which zsh) $(whoami) | |
curl -L http://install.ohmyz.sh | sudo zsh | |
cd ~/.oh-my-zsh/themes | |
sudo curl -O https://gist.githubusercontent.com/kytu800/0d38f0857821fe95ab72/raw/bfdc12eda9036c459fa990eed970dfbf28da9242/kytu.zsh-theme | |
perl -pi -e 's/robbyrussell/kytu/g' ~/.zshrc | |
## hostname | |
echo "mongodb" | sudo tee /etc/hostname |
NewerOlder