Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#dir define
myfonts_dir=/usr/share/fonts/truetype/myfonts
remote_dir=http://files.cnblogs.com/DengYangjun
#fonts define
monaco=monaco-linux.ttf
lucida=lucida-console.ttf
msyh=msyh.ttf
@lwjef
lwjef / proxy.sh
Created November 13, 2011 09:41
goagent and ssh proxy
#!/bin/bash
#自行替换 username, host, port,password
python ~/goagent-local/proxy.py & plink -N -v username@host -D 127.0.0.1:port -pw password
#!/usr/bin/python
from os import listdir, symlink, makedirs
from os.path import basename, join, isdir, isfile, islink, getsize, exists
def all_entry(entry):
return True
def to_bytes(size):
if size.endswith("K"):
return int(size[:-1]) * 1024
@lwjef
lwjef / twitter_list_to_opml.py
Created April 6, 2012 12:22 — forked from myles/twitter_list_to_opml.py
A simple python script that creates an OPML file of a Twitter user's lists.
#!/usr/bin/env python
"""
A simple script that creates an OPML file of the RSS feeds to
a Twitter user's lists.
python twitter_list_to_opml.py mylesb
Copyright (c) 2010, Myles Braithwaite <me@mylesbraithwaite.com>
All rights reserved.
@lwjef
lwjef / url2opml.py
Created April 9, 2012 12:07
create opml from url
# coding=utf-8
from BeautifulSoup import BeautifulSoup
import urllib2
import sys, os
reload(sys)
sys.setdefaultencoding('utf-8')
input_file = sys.argv[1]
output_opml = sys.argv[2]
@lwjef
lwjef / generate-opml.php
Created April 11, 2012 14:16 — forked from ramsey/generate-opml.php
Generate OPML file from Delicious blogroll tag
#!/usr/local/bin/php
<?php
include_once('getRSSLocation.php');
// del.icio.us username and password
$username = 'your_username';
$password = 'your_password';
$cache_file = '/tmp/delicious-blogroll.xml';
$blogs = array();
@lwjef
lwjef / mkt.sh
Last active December 11, 2015 04:39
Get Bing mkt code.
# http://msdn.microsoft.com/en-us/library/dd251064.aspx
for mkt in "ar-XA" "bg-BG" "cs-CZ" "da-DK" "de-AT" "de-CH" "de-DE" "el-GR" "en-AU" "en-CA" "en-GB" "en-ID" "en-IE" "en-IN" "en-MY" "en-NZ" "en-PH" "en-SG" "en-US" "en-XA" "en-ZA" "es-AR" "es-CL" "es-ES" "es-MX" "es-US" "es-XL" "et-EE" "fi-FI" "fr-BE" "fr-CA" "fr-CH" "fr-FR" "he-IL" "hr-HR" "hu-HU" "it-IT" "ja-JP" "ko-KR" "lt-LT" "lv-LV" "nb-NO" "nl-BE" "nl-NL" "pl-PL" "pt-BR" "pt-PT" "ro-RO" "ru-RU" "sk-SK" "sl-SL" "sv-SE" "th-TH" "tr-TR" "uk-UA" "zh-CN" "zh-HK" "zh-TW"; do
xmlURL="http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=$mkt"
(echo $(curl -s $xmlURL) | grep -o "<urlBase>.\+</urlBase>" | grep "ROW" || echo $mkt) | grep -v "ROW"
done
@lwjef
lwjef / Disable_Wi-Fi.vbs
Last active December 3, 2018 14:40 — forked from simply-coded/Disable_Wi-Fi.vbs
Use VBScript to enable, disable, or toggle a connection like your Wi-Fi on and off.
'************************
'Name: Disable Connection
'Author: Jeremy England
'Company: SimplyCoded
'Date: 10/01/2016
'************************
Option Explicit
Dim interface, interfaceName, interfaceTarget, available, verb
'Pick the Interface Name you want to disable
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <chrono>
#include <cstdlib>
// 打印耗时情况.
inline void print_duration(std::chrono::steady_clock::time_point start_t,
std::chrono::steady_clock::time_point end_t)