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
#!/usr/bin/env python | |
import getpass, mechanize, optparse, os.path, sys | |
parser = optparse.OptionParser() | |
parser.add_option('--login') | |
parser.add_option('--password') | |
parser.add_option('--filename') | |
parser.add_option('--description') | |
parser.add_option('--private', action='store_true', default=False) |
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
[Nov 6 14:54] Sense Key : Medium Error [current] [descriptor] | |
[ +0.000004] Descriptor sense data with sense descriptors (in hex): | |
[ +0.000001] 72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 | |
[ +0.000010] 73 20 92 19 | |
[ +0.000005] sd 0:0:0:0: [sda] | |
[ +0.000002] Add. Sense: Unrecovered read error - auto reallocate failed | |
[ +0.000003] sd 0:0:0:0: [sda] CDB: | |
[ +0.000001] Read(10): 28 00 73 20 92 19 00 00 01 00 | |
[ +0.000008] end_request: I/O error, dev sda, sector 1931514393 | |
[ +0.000004] Buffer I/O error on device sda3, logical block 1929445913 |
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
# Zach Champion | |
# Calculus II - Honors Calculus Project | |
# A script in Python that returns a decimal expansion of pi using the | |
# Gauss-Legendre algorithm. | |
from __future__ import with_statement | |
# Used the decimal module for increased accuracy that the standard float |
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 argparse | |
import ConfigParser | |
conf_parser = argparse.ArgumentParser( | |
# Turn off help, so we print all options in response to -h | |
add_help=False | |
) | |
conf_parser.add_argument("-c", "--conf_file", | |
help="Specify config file", metavar="FILE") | |
args, remaining_argv = conf_parser.parse_known_args() |
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
#PySocksのパッケージをアップデートするコントリビューションの例です。 | |
# gentooのgithubにあるパッケージレポジトリをフォックします。 | |
#gitでクローンします。 | |
git clone --depth=50 https://github.com/aliceinwire/gentoo.git aliceinwire_gentoo | |
#レポジトリに入ります。 | |
cd aliceinwire_gentoo | |
#upstreamレポジトリ追加します。 | |
git remote -v | |
git remote add upstream git@github.com:gentoo/gentoo.git | |
git remote -v |
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
# listing emerge compiling time | |
function emergetime { | |
genlop -nt '*' | | |
tail -n +3 | | |
sed -n ' | |
1~3 {x;b} | |
3~3 d | |
# prefix 0 | |
s/ \([0-9] \)/ 0\1/g | |
# remove "," and "and" |
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
$ cat .xprofile | |
eval "$(dbus-launch --sh-syntax --exit-with-session)" | |
export XMODIFIERS="@im=fcitx" | |
export QT_IM_MODULE=fcitx | |
export GTK_IM_MODULE=fcitx | |
fcitx |
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
diff -Nupr src.orig/fs/proc/meminfo.c src/fs/proc/meminfo.c | |
--- src.orig/fs/proc/meminfo.c 2017-11-17 15:58:41.113211972 -0500 | |
+++ src/fs/proc/meminfo.c 2017-11-17 15:58:58.554211972 -0500 | |
@@ -42,6 +42,8 @@ static void show_val_kb(struct seq_file | |
seq_write(m, " kB\n", 4); | |
} | |
+static int foo = 5; | |
+ | |
static int meminfo_proc_show(struct seq_file *m, void *v) |
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
""" | |
Script to delete large folder in gmail. | |
Adapted from: http://ae.ro/1upv7rt | |
Notes: | |
1. For this to work with gmail, you will need to adjust into your IMAP settings | |
so that they look like this: | |
* IMAP: enabled |
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
du -cks * | sort -rn | head -11 | |
# Usually set this up in my bash profile as an alias: | |
# alias ducks='du -cks * | sort -rn | head -11' | |
# Because it is fun to type ducks on the command line. :) |