User:GWicke/Notes

Job queue edit

Talk:Job_queue_redesign#Idea_dump:_HTTP-based_lightweight_jobs.2C_async_job_runner

GIT edit

transplanting git patches edit

# all patches since origin, one per file
git format-patch origin
# import a patch
git am < some.patch

Tracking all remote branches locally edit

My ~/bin/git-track-all-remote-branches shell script:

#!/bin/sh
git branch -r | egrep -v 'master|->' | while read remote; do
    echo $remote
    git checkout --track "$remote"
done

pushing directly to gerrit head edit

Side-steps code review, useful for transplanting / importing past history from another repo.

Change the gerrit config to be very permissive (at least Create Reference, Push, Push Merge Commit and Push Annotated Tag permissions), and then do

git push gerrit HEAD:refs/heads/master

This needs to happen from a checkout of the repo you want to push to. Pull / cherry-pick the patches you want to transplant from another checkout of the repo with common lineage.

Systemd and node edit

LVS / ext4 resize edit

Shrinking:

# Unmount the filesystem and check its' LV
e2fsck -f /dev/mapper/vg0-foo
 
# Shrink ext4 and the LV to the desired size; 
# -r implies fs resize equivalent to 'resize2fs -p /dev/mapper/vg0-foo 40G'
lvreduce -r -L 40G /dev/mapper/vg0-foo

Growing:

# prepare a physical volume
pvcreate /dev/sdd1
vgextend praseodymium-vg /dev/sdd1
 
# Extend the LV to use all free space
# -r implies 'resize2fs -p /dev/mapper/vg0-bar'
lvextend -r -l +100%FREE /dev/mapper/vg0-bar
e2fsck -f /dev/mapper/vg0-bar

Slow-parse log edit

on fluorine, in /a/mw-log

sort -k5 -n slow-parse.log | less

Current output:

2013-03-27 22:31:13 mw1103 enwiki: 122.01 Saturday_Night_Live
2013-03-27 18:07:57 mw1073 arwiki: 123.68 محمد
2013-03-27 10:45:16 mw1080 zhwiki: 123.77 Template:PRC_admin/articlelist
2013-03-27 22:31:13 mw1127 enwiki: 123.84 Tron:_Legacy
2013-03-27 23:38:02 mw1212 arwiki: 124.13 قوائم_فرق_كأس_العالم_لكرة_القدم_2006
2013-03-27 22:31:15 mw1178 enwiki: 124.71 UBS
2013-03-27 14:17:01 mw1178 arwiki: 124.86 قوائم_فرق_كأس_العالم_لكرة_القدم_2006
2013-03-27 22:31:29 mw1096 enwiki: 124.93 Space_Shuttle_Challenger_disaster
2013-03-27 15:11:36 mw1021 arwiki: 125.82 قوائم_فرق_كأس_العالم_لكرة_القدم_2006
2013-03-27 15:10:37 mw1088 arwiki: 126.33 قوائم_فرق_كأس_العالم_لكرة_القدم_2006
2013-03-27 22:31:17 mw1053 enwiki: 126.58 The_Avengers_(2012_film)
2013-03-28 00:18:28 mw1050 metawiki: 127.20 List_of_Wikipedias_by_language_group
2013-03-27 18:48:12 mw1104 enwiki: 128.23 Wikipedia:Good_articles/all
2013-03-27 09:23:00 mw1062 ukwiki: 128.85 Користувач:Tttaaannne/Червоні_посилання_в_категорії_«Харківська_область»
2013-03-27 11:15:14 mw1106 arwiki: 130.05 محمد
2013-03-27 12:35:39 mw1081 arwikisource: 130.53 البداية_والنهاية/الجزء_الرابع/صفحة_واحدة
2013-03-27 22:31:34 mw1163 enwiki: 130.63 Cristiano_Ronaldo
2013-03-27 22:36:40 mw1081 enwiki: 133.83 User:Tuvalkin/BSiconDH
2013-03-27 20:18:00 mw1162 arwiki: 135.42 ويكيبيديا:قوائم_المراقبة_الاختصاصية/حياة
2013-03-27 14:15:41 mw1047 arwiki: 137.49 قوائم_فرق_كأس_العالم_لكرة_القدم_2006
2013-03-27 20:48:01 mw1041 arwiki: 138.53 مستخدم:Ciphers/مسودة
2013-03-27 20:08:33 mw1086 arwikisource: 138.55 السيرة_الحلبية/الجزء_الرابع
2013-03-27 16:42:50 mw1137 arwiki: 139.66 المغرب
2013-03-27 22:31:42 mw1026 enwiki: 143.04 Alabama
2013-03-27 20:47:14 mw1077 arwiki: 150.19 مستخدم:Ciphers/مسودة
2013-03-27 21:40:50 mw1110 arwiki: 152.96 ويكيبيديا:جائزة_المنتج_-_النصف_الثاني_لعام_2011/Avocato
2013-03-27 22:36:21 mw1128 enwiki: 153.37 User:CRwikiCA/sandbox
2013-03-27 17:46:19 mw1175 ukwiki: 154.24 Вікіпедія:Проект:Харків
2013-03-27 09:08:48 mw1162 zhwiki: 158.66 广西壮族自治区乡级以上行政区列表
2013-03-27 16:51:01 mw1034 zhwiki: 165.89 陕西省乡级以上行政区列表
2013-03-27 18:43:32 mw1051 zhwiki: 169.10 辽宁省乡级以上行政区列表
2013-03-27 20:25:44 mw1053 arwiki: 169.22 ويكيبيديا:قوائم_المراقبة_الاختصاصية/طب
2013-03-27 18:42:32 mw1021 zhwiki: 169.30 辽宁省乡级以上行政区列表
2013-03-27 20:19:35 mw1087 arwiki: 171.00 ويكيبيديا:قوائم_المراقبة_الاختصاصية/حياة
2013-03-27 09:10:00 mw1089 zhwiki: 171.41 广西壮族自治区乡级以上行政区列表
2013-03-27 07:18:40 mw1079 arwiki: 175.30 ملحق:قائمة_الدول_حسب_عدد_الدول_المجاورة
2013-03-27 21:40:15 mw1102 arwiki: 177.19 ويكيبيديا:جائزة_المنتج_-_النصف_الثاني_لعام_2011/Avocato
2013-03-27 07:17:59 mw1064 arwiki: 177.20 ملحق:قائمة_الدول_حسب_عدد_الدول_المجاورة
2013-03-27 16:50:13 mw1023 zhwiki: 177.47 陕西省乡级以上行政区列表
2013-03-27 12:58:09 mw1180 arwikisource: 183.56 مختصر_الزبيدي

Organizational edit

Sum up cpu usage of groups of processes edit

top -b -n10 | awk '{ if ($12 == "nodejs") NODE += $9; if ($12 == "java" ) JAVA += $9 } END { print "node", NODE, "java", JAVA }'