Skip to content

Instantly share code, notes, and snippets.

View lowstz's full-sized avatar
🐡
专业摸鱼

Aaron Chen lowstz

🐡
专业摸鱼
View GitHub Profile
@lowstz
lowstz / rc.lua
Created August 20, 2012 10:35
awesome 音量控制
-- volume control
awful.key({ modkey, }, "Up", function () awful.util.spawn_with_shell("amixer -q sset Master 10%+ unmute") end),
awful.key({ modkey, }, "Down", function () awful.util.spawn_with_shell("amixer -q sset Master 10%- unmute") end),
awful.key({}, "XF86AudioMute", function () awful.util.spawn_with_shell("amixer -q sset Master toggle") end),
awful.key({}, "XF86AudioLowerVolume", function () awful.util.spawn_with_shell("amixer -q sset Master 10%- unmute") end),
awful.key({}, "XF86AudioRaiseVolume", function () awful.util.spawn_with_shell("amixer -q sset Master 10%+ unmute") end),
@lowstz
lowstz / rc.lua
Created August 19, 2012 14:31
awesome wm 下 Fn + F8的功能
-- Thinkpad Touchpad Toggle for awesome wm
awful.key({}, "XF86TouchpadToggle", function ()
awful.util.spawn_with_shell("synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')") end),
@lowstz
lowstz / HanoiTwoer.java
Created April 10, 2012 13:48
河内塔
//: HanoiTwoer.java
public class HanoiTower {
// 教材用递归,我还是用循环把 =。=
public static void move(int n, char from, char to, char aux) {
if(n == 1) {
System.out.println("将#1盘从" + from + "移到" + to);
}
else {
for(int i=1; i<n; i++){
@lowstz
lowstz / mlx.sh
Created April 3, 2012 16:40
配合xunlei-lixian可以批量下载符合关键字的任务
#!/bin/bash
#
## 这个脚本配合xunlei-lixian可以批量下载符合关键字的任务
## https://github.com/iambus/xunlei-lixian
## 感谢iambus写出如此好用的神器
#
## linux或mac下批量添加人人影视ed2k的chrome插件
## http://disinfeqt.com/yyets/
if [ $# -eq 0 -o $# -gt 9 ]; then
@lowstz
lowstz / raw.diff
Created March 9, 2012 07:15
test raw tag for octopress
--- 2012-03-09-test.markdown 2012-03-09 10:21:46.000000000 +0800
+++ 2012-03-09-test-raw.markdown 2012-03-09 15:11:59.905807062 +0800
@@ -9,18 +9,21 @@
This type of code highlight can not work properly in the blog page.
{% codeblock lang:ruby %}
+{% raw %}
{% capture description %}
{% if page.description %}
{{ page.description }}
@lowstz
lowstz / install-jdee.sh
Created February 28, 2012 19:55
A simple script to install JDE for Emacs (JDEE)
#!/bin/sh
# Change `ELISP_DIR` variable as you needed
ELISP_DIR="$HOME/.emacs.d/site"
MIRROR="https://lowstz.org/jdee"
echo -n "This script require wget and unzip, please ensure that your system has been installed them?[yes/no]:"
read choice
case $choice in
YES|yes|Y|y)
@lowstz
lowstz / auto-ovpn.sh
Created February 8, 2012 15:22 — forked from xream/MacVPN.sh
Linux openvpn auto reconnect script
#!/bin/bash
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
### Thanks Xream's Work XD
# if you don't have several vpn servers to select, you can comment following line
# and use your openvpn config file name to replace "${host}.ovpn" in while loop.
read -p "Select the host: " host
layout title date comments categories
post
Installing Octopress (Fedora Version)
2012-02-05 06:13
true
fedora linux octopress ruby rvm jekyll rubygems

I (rather obviously) recently found myself attempting to install Octopress. Sure, it has great documentation, but some areas were lacking -- specifically, initial setup. As someone who has not worked with Ruby before other than a rather limited Windows install for a jekyll project, I had virtually no experience installing Ruby, using RVM, or even playing with RubyGems.