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
/** | |
* @author Nguyen Viet Hung ([email protected]) | |
* @version 1.0 | |
* SmartOnTouchListener class help convert your onTouch into single-click and drag&drop, double-click and drag&drop or long-click and drag&drop | |
*/ | |
package com.aps.smartbar.quicksettings.service; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.SharedPreferences; |
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
1. Customize blog layout | |
2. Write many post |
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/env python | |
import smtplib | |
from datetime import datetime | |
SMTP_SERVER = 'smtp.gmail.com' | |
SMTP_PORT = 587 | |
sender = '[email protected]' | |
subject ='[BirthReminder] Happy birthday to you! from C2k8pro' | |
password = 'xxxxxx' |
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
1365 ip ru g | |
1366 ip ru get | |
1371 ip ru | |
1877 ip ru | |
1878 ip ru del pref 32766 | |
1880 ip ru ad from all lookup main pref 20 | |
1881 ip ru ad from all lookup table 90 | |
1882 ip ru ad from all lookup 90 | |
1883 ip ru | |
1908 ip ru |
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
iproute commands | |
Prerequisites | |
iproute2 package | |
kernel configure options: | |
CONFIG_IP_ADVANCED_ROUTER=y | |
CONFIG_IP_MULTIPLE_TABLES=y | |
CONFIG_IP_ROUTE_MULTIPATH=y | |
menuconfig path: |
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 requests | |
import json | |
HOST = "http://0.0.0.0:8080/create" | |
rules = [{"ip" : "123.123.123.123", "type":"all"}, | |
{"ip" : "192.168.4.130" , "type" : "all"}, | |
{"ip" : "192.168.3.182" , "type" : "all"}, | |
{"ip" : "123.30.53.12" , "type" : "all"}, | |
{"ip" : "222.255.27.156" , "type" : "all"}, | |
{"ip" : "1.2.3.4", "type" : "ftp"}, |
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 requests | |
import json | |
HOST = "http://0.0.0.0:8080/create" | |
rules = [{"ip" : "123.123.123.123", "type":"all"}, | |
{"ip" : "192.168.4.130" , "type" : "all"}, | |
{"ip" : "192.168.3.182" , "type" : "all"}, | |
{"ip" : "123.30.53.12" , "type" : "all"}, | |
{"ip" : "222.255.27.156" , "type" : "all"}, | |
{"ip" : "1.2.3.4", "type" : "ftp"}, |
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
def make_bezier(xys): | |
# xys should be a sequence of 2-tuples (Bezier control points) | |
n=len(xys) | |
combinations=pascal_row(n-1) | |
def bezier(ts): | |
# This uses the generalized formula for bezier curves | |
# http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Generalization | |
result=[] | |
for t in ts: | |
tpowers=(t**i for i in range(n)) |
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
from PIL import Image, ImageDraw | |
from bezier import * | |
if __name__=='__main__': | |
im = Image.new('RGBA', (100, 100), (0, 0, 0, 0)) | |
draw = ImageDraw.Draw(im) | |
ts=[t/100.0 for t in range(101)] | |
xys=[(50,100),(80,80),(100,50)] | |
bezier=make_bezier(xys) |
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
<domain type='kvm' id='4'> | |
<name>first</name> | |
<uuid>a65f501c-78cb-82de-57d4-0f02bccf68cd</uuid> | |
<memory>524288</memory> | |
<currentMemory>524288</currentMemory> | |
<vcpu>1</vcpu> | |
<os> | |
<type arch='x86_64' machine='pc-1.0'>hvm</type> | |
<boot dev='hd'/> | |
</os> |
OlderNewer