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
ps axo "rss,ucomm" | awk '/Geek/ {printf "%.2f", $1/1024}' |
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
ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{print ("System Battery: ",$10/$5 * 100,"%")}'; | |
osascript -e 'set a to do shell script "ioreg -w0 -l | grep Capacity"' -e "set h to word 5 of a" -e "set z to word 33 of a" -e "set b to word 38 of a" -e "set c to 1000 * b / z" -e "set d to round c" -e "set f to d / 10" -e "set q to 1000 * h / b" -e "set w to round q" -e "set j to w / 10" -e '"Battery Health: " & j &"%"' | iconv -f utf-8 -t ucs-2-internal; | |
ioreg -w0 -l | grep "Cycle Count" | awk 'BEGIN { FS = "=" } ; {print $8}' | awk 'BEGIN { FS = "}" } ; {print $1, "Cycles"}'; | |
tbatt=`ioreg -c BNBTrackpadDevice | grep BatteryPercent | tail -1|awk '{print $10}'`; | |
if [ ${#tbatt} -lt 1 ]; then | |
echo "Magic Trackpad: disconnected" | |
else | |
echo "Magic Trackpad Battery: $tbatt%" |
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
top -l 1 | awk '/PhysMem/ {print "" $8 " "}' ; |
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
ps -amcwwwxo "command %mem %cpu" | grep -v grep | head -19 |
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
35a36,40 | |
> (defun elscreen-booleanp (value) | |
> "Return t if VALUE is boolean. | |
> This implements GNU Emacs 22.1's `booleanp' function in earlier Emacs. | |
> This function may be removed when Emacs 21 is no longer supported." | |
> (or (equal value t) (equal value nil))) | |
136c141 | |
< (when (or (booleanp value) | |
--- | |
> (when (or (elscreen-booleanp value) |
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 java.lang.management.*; | |
import java.util.List; | |
public class GC { | |
public static void main(String args[]) { | |
List<GarbageCollectorMXBean> l = ManagementFactory.getGarbageCollectorMXBeans(); | |
for (GarbageCollectorMXBean b : l) { | |
System.out.println(b.getName()); | |
} | |
} |
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
-- super userで実行する | |
# echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="ベンダーID", MODE="0666", GROUP="plugdev"' > /etc/udev/rules.d/51-android.rules | |
# chmod a+r /etc/udev/rules.d/51-android.rules | |
-- 一般ユーザでもよい | |
$ ./adb kill-server | |
$ sudo ./adb start-server |
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
#!/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'net/http' | |
def get_the_latest_changed_file(repos, rev) | |
IO.popen(sprintf('/usr/local/bin/svnlook changed %s -r %s', repos, rev)) {|io| | |
# 最初の行を返す | |
io.gets |
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
#!/bin/sh | |
REPOS="$1" | |
REV="$2" | |
ruby $REPOS/hooks/post-commit.rb "$REPOS" "$REV" |
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
<?xml version="1.0"?> | |
<!DOCTYPE module PUBLIC | |
"-//Puppy Crawl//DTD Check Configuration 1.3//EN" | |
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |
<!-- | |
Checkstyle configuration that checks the sun coding conventions from: | |
- the Java Language Specification at |
OlderNewer