Skip to content

Instantly share code, notes, and snippets.

Avatar

Leonard Huang lueo

View GitHub Profile
@lueo
lueo / reposync.sh
Last active December 3, 2017 00:17 — forked from skunkie/reposync.sh
This bash script synchronizes local repositories with external repositories, RPM, reposync, createrepo
View reposync.sh
#!/bin/bash
# requires bash version 4
# This script synchronizes local repositories with
# external repositories
#
############################################################
# PREREQUISITES
############################################################
for util in reposync createrepo; do
@lueo
lueo / aws_ip_ranges.py
Created February 21, 2016 09:47
Get aws ip ranges
View aws_ip_ranges.py
#!/usr/bin/python
import requests
import json
r = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json')
j = r.json()
print j['createDate']
for c in j['prefixes']:
@lueo
lueo / example.md
Last active December 15, 2015 09:19 — forked from ashigeru/example.md
View example.md
# link somewhere
$ link -s
$ punk you

Section

aaa

@lueo
lueo / cgminer-fpm.sh
Created July 11, 2012 03:59
Packaging .deb for cgminer 2.9.5 on xubuntu 64-bit (or ubuntu) using fpm
View cgminer-fpm.sh
#!/bin/sh
TEMP_PATH=/tmp/cgminer
CGMINER_FILE=cgminer-2.9.5-x86_64-built
echo '=> Getting cgminer...'
if [ ! -e $CGMINER_FILE.tar.bz2 ]; then
curl -O http://ck.kolivas.org/apps/cgminer/$CGMINER_FILE.tar.bz2
fi
tar jxf $CGMINER_FILE.tar.bz2
@lueo
lueo / elec_cost_cals.py
Created April 16, 2012 07:24
台灣電費計算
View elec_cost_cals.py
# -*- coding: utf-8 -*-
# Calculate basic electric usage cost in Taiwan
#
# From: http://www.taipower.com.tw/TaipowerWeb/upload/files/11/main_3_6_3.pdf
# Update (4/13/2012): 最新電價表 http://www.moea.gov.tw/Mns/populace/news/wHandNews_File.ashx?news_id=25156&serial_no=2
#
# ===> 以下為舊電價表
#四、表燈用電
# (一)非時間電價
@lueo
lueo / Stack is guilty!
Created February 19, 2012 08:41
Interesting text from bitcoin blockchain (as of 2012/Feb/18)
View Stack is guilty!
EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks
z+o>z+o>z+o>z+o>z+o>
z+o>z+o>z+o>z+o>z+o>
z+o>z+o>z+o>z+o>z+o>
z+o>z+o>z+o>z+o>z+o>
z+o>z+o>z+o>z+o>z+o>
z+o>z+o>z+o>z+o>z+o>
=ybegin line=128 siz
e=8776 name=bitcoin.
***2*.+D*/***+***h+E