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 bash | |
# | |
# Translate with google-translate into X server OR tmux | |
# Bind it to shortcut | |
# | |
# @link http://habrahabr.ru/blogs/linux/137215/ | |
# | |
if [ -z $TMUX ]; then |
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
diskToTrack=/ | |
pidToStop=$(pgrep sort) | |
leftPercents=97 | |
while [ 1 ] ; do if [[ $(df $diskToTrack | tail -n+2 | awk '{sub(/%/,"",$5); print $5}') -gt $leftPercents ]]; then kill -STOP $pidToStop && break; else sleep 30; fi; done |
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
gawk '{if ($1 ~ /^[0-90-f]+$/ && name ~ /^\./) { printf "[%25s] %.0f\n", name, strtonum("0x" $1); } name=$(NF > 3 ? NF-3 : ""); }' |
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 bash | |
set -e | |
pipe=test.pipe | |
lines=2 | |
mount -o size=100M -t tmpfs tmpfs /tmp | |
cd /tmp |
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 bash | |
echo "Stage 1: modified" | |
git st -s | grep '^ M' | fgrep .kde | awk '{print $NF}' | \ | |
xargs -r -i sh -c 'mv {} /tmp/ && echo {} >> .gitignore' | |
git ci .kde/share/config .gitignore -m 'ignore: more dynamic configs (modified)' | |
git show .gitignore | grep ^+.kde | awk -F/ '{print $NF}' | xargs -r -i mv /tmp/{} .kde/share/config/ | |
echo "Stage 2: untracked" | |
git st -s -uall | grep '^??' | awk '{print $NF}' | xargs -r -i sh -c 'echo {} >> .gitignore' |
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
From 0eaed7aadfc62b55aee51a740050a45aab5b302d Mon Sep 17 00:00:00 2001 | |
From: Qolt <ysemenov.mail@gmail.com> | |
Date: Sun, 23 Jun 2013 20:16:30 +0400 | |
Subject: [PATCH] Added Boostcache class, to iprovide a Python interface for | |
boostcache (https://github.com/azat/boostcache) | |
--- | |
redis/__init__.py | 4 ++-- | |
redis/client.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ | |
2 files changed, 46 insertions(+), 2 deletions(-) |
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
find refs -type f | fgrep -v :: | xargs -I{} sh -c 's=$(fgrep size {} | awk -F"[<>]" "{print \$3}"); [ -z "$s" ] || echo {}: $s' | sort -k2nr |
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 bash | |
set -e | |
PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
interface=${1:-"usb0"} | |
if [ ! -d /sys/class/net/$interface ]; then | |
cat - >&2 <<EOL |
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 bash | |
mkdir -p test/mnt | |
./fusefs -s -o nonempty $PWD/test/mnt/ | |
cd /sys/kernel/debug/tracing | |
functions=( | |
fuse_dev_do_write | |
fuse_copy_one |
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
thread#5: thread#1: | |
- lock(bufev->lock) # waiting, blocked by #t1 | |
- bufferevent_setcb(bufev=0x64f350, ...) | |
- send_http_response() - lock() # waiting, blocked by #t5 | |
- device_chunk_cb() - evbuffer_get_length("device1->pending->bufev") | |
- device_read_cb(bev=0x6396d0, arg="device1") - device_write_cb(bev=0x64f350, arg="device1") | |
- bufferevent_trigger_nolock_() - bufferevent_trigger_nolock_() | |
- lock(bufev->lock (0x6396d0)) - lock(bufev->lock(0x64f350)) | |
- bufferevent_readcb(arg=0x6396d0) - bufferevent_writecb(arg=0x64f350) | |
- event_persist_closure() - event_persist_closure() |