Skip to content

Instantly share code, notes, and snippets.

View hvnsweeting's full-sized avatar

Viet Hung Nguyen hvnsweeting

View GitHub Profile
@hvnsweeting
hvnsweeting / canhngo.txt
Created December 13, 2012 16:09
Canh ngọ
Tuổi Mậu Ngọ năm nay 33t.
Tôi thấy tuổi này Nam và Nữ rất vượng về đường công danh. Chuyện tình cảm thì hơi khó nói. Bởi ng sinh năm Ngọ như con ngựa bất kham.
Thường thẳng tính, và có phần ngang bướng. Thích làm theo ý kiến bản thân.
---------
Thân Gửi bạn Uchiha!
- Trước khi đề cập đến vấn đề kết hôn mình xin chia sẻ với bạn điều sau. Năm 2015 là năm tốt nhất trong cuộc đời đối với tuổi Canh Ngọ (1990). Và ngày may mắn nhất đó là 18/07/2015 dương lịch ( 03/06/2015 âm lịch). Nhưng mà may mắn đến đâu và mức độ nào thì còn tùy vào âm đức nữa bạn nhé.
- Giờ đề cập đến chuyện kết hôn của bạn, hai tuổi này không khắc nhau về ngũ hành và nạp âm bạn nhé. Nếu xét kỹ thì hai bạn hơi khắc về tháng ( một người tháng Thìn - một người tháng Tuất). Còn một phần quan trong nữa là xét về tính cách, cái này bạn tự xét ha vì mình không có gặp trực tiếp hai bạn, ( nhiều tuổi xung khắc nhưng tính cách biết nhường nhịn vẫn sống với nhau hạnh phúc).
#!/bin/bash
apt-get -y install denyhosts
echo 'Acquire::http { Proxy "http://10.0.0.12:3142"; };' > /etc/apt/apt.conf.d/02proxy
echo "yahooo, you save 20% your salary!" > save20.log
@hvnsweeting
hvnsweeting / save20all.sh
Created December 22, 2012 05:30
edit line 17 to your ip , then just run to save your salary 20% :) for vccloud-bbteam
#!/bin/bash
# Sat Dec 22 12:27:28 ICT 2012
# by HVN
scriptname='saveu20.sh'
cat <<- _EOF_ > $scriptname
#!/bin/bash
apt-get -y install denyhosts
echo 'Acquire::http { Proxy "http://10.0.0.12:3142"; };' > /etc/apt/apt.conf.d/02proxy

Hanoi, 2012/12/26

Introduction to Bash * Vim * Git

  • Tools for work efficently on Linux environment
  • Small * powerful * portable * easy to learn (but not easy to master)

Bash

#!/bin/bash
egrep -o '[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9]+' $1
import re
from pprint import pprint
if __name__ == "__main__":
sample = " Here we go again: FXGA-AE3B-P87D-XG2H - Because today is a great day like @EmanuelCanataro said"
pattern = '[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9]+'
match = re.findall(pattern, sample)
pprint(match)
#!/usr/bin/env python
from fabric.api import *
env.hosts = ["192.168.122.158"]
env.forward_agent = True
def nginxset():
sudo('apt-get install -y nginx')
#TODO config nginx
sudo('service nginx restart')
#!/usr/bin/env python
from fabric.api import *
def img():
env.hosts = ["192.168.122.158"]
env.forward_agent = True
def nginxset():
#!/usr/bin/env python
from fabric.api import *
def host():
env.hosts = ["192.168.122.158"]
#env.password = {'[email protected]': 'hehehe', '[email protected]':'hehehe'}
env.passwords = {'[email protected]': 'hehehe', '[email protected]':'hehehe'}
#!/usr/bin/env python
#Today: Sat Jan 5 10:26:43 ICT 2013
#by hvn
import subprocess as spr
import os
import tempfile
#TODO: multi thread / multiprocess
#NOTE tao truoc cac repo tren srvgit moi