Skip to content

Instantly share code, notes, and snippets.

View cnDelbert's full-sized avatar

Delbert cnDelbert

View GitHub Profile
@cnDelbert
cnDelbert / How to install tcpping on Linux.md
Last active March 18, 2024 14:27
How to install tcpping on Linux

To install tcptraceroute on Debian/Ubuntu:

$ sudo apt-get install tcptraceroute

To install tcptraceroute on CentOS/REHL, first set up RepoForge on your system, and then:

$ sudo yum install tcptraceroute
@cnDelbert
cnDelbert / QrCode Bookmark-sae.js
Last active August 29, 2015 14:12
Click the bookmark to generate the QrCode. Click on the image of the QrCode to destory it.
javascript:((function(){document.body.innerHTML=document.body.innerHTML+"<div%20id='MyQrCode'%20style='display:block;z-index:99999;position:fixed;top:0;right:0;'%20onclick='javascript:(function(){var%20MyQrCode=document.getElementById(&quot;MyQrCode&quot;);MyQrCode.parentNode.removeChild(MyQrCode);}())'><img%20src='http://png.2vma.theucd.com/chart?chl="+escape(document.location.href)+"&chs=200x200&cht=qr&chld=%7C1&choe=UTF-8'></div>";})());
@cnDelbert
cnDelbert / Panorama pics from Google.py
Last active August 29, 2015 14:08
Modify the path to save and the url which obtained, the script can download the pictures and paste them into one. The two files fit different URL formats.
# -*- coding:utf-8 -*-
__author__ = 'Delbert'
# for Python 3.4 and Python 2.7
# Pillow and request module are needed
import requests
import os
from PIL import Image
save_path = "notre-dame-cathed1"
@cnDelbert
cnDelbert / SyntaxHighlighterJS.py
Created October 24, 2014 14:13
Download all js and css files from SyntaxHighlighter
# coding:utf-8
# Python 3.4
# Download all js and css files from SyntaxHighlighter
# __author__ = Delbert
from urllib import request
url_arr = ["http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css",
"http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js",
"http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js",
"http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js",
@cnDelbert
cnDelbert / is_prime.py
Created October 15, 2014 05:52
Return True if n is a prime number otherwise return False
def is_prime(n):
'Return True if n is a prime number otherwise return False'
if n == 0 or n == 1:
return False
else:
for i in range(2, n):
if n%i == 0:
return False
return True
@cnDelbert
cnDelbert / unsplash.py
Last active November 15, 2017 02:08
一个简单的unsplash全站下载脚本。 使用Python3及BeautifulSoup4。
# -*- coding:utf-8 -*-
__author__ = 'Delbert'
# Using Python3
# beautifulsoup4 is needed.
from bs4 import BeautifulSoup
from urllib import request
import os
def main():
begin_page = int(input("From: "))