From 36f7747780ea5f459e17f34c42d646abff6e6dbc Mon Sep 17 00:00:00 2001 From: epochqwert Date: Wed, 19 Dec 2018 19:33:37 +0000 Subject: updated scripts, and xchg stuff added --- bin/rates | 24 +++++++ bin/xchg.buy | 89 +++++++++++++++++++++++ bin/xchg.getdoublerate | 3 + bin/xchg.getrate | 3 + bin/xchg.getrates | 3 + bin/xchg.give | 90 +++++++++++++++++++++++ bin/xchg.help | 10 +++ bin/xchg.init | 4 ++ bin/xchg.list | 5 ++ files/useraliases | 188 ++++++++++++++++++++++++++++++++++++++++++++----- scripts/command | 2 +- scripts/cowsay.lua | 26 +++++++ scripts/drink.sh | 5 ++ scripts/listtofile | 4 ++ scripts/prestartup | 14 ++-- scripts/shell | 2 +- scripts/startup | 39 +++++----- 17 files changed, 466 insertions(+), 45 deletions(-) create mode 100644 bin/rates create mode 100755 bin/xchg.buy create mode 100755 bin/xchg.getdoublerate create mode 100755 bin/xchg.getrate create mode 100755 bin/xchg.getrates create mode 100755 bin/xchg.give create mode 100644 bin/xchg.help create mode 100755 bin/xchg.init create mode 100755 bin/xchg.list create mode 100755 scripts/drink.sh create mode 100644 scripts/listtofile diff --git a/bin/rates b/bin/rates new file mode 100644 index 0000000..5a92b59 --- /dev/null +++ b/bin/rates @@ -0,0 +1,24 @@ +{ + "USD" : {"15m" : 6427.15, "last" : 6427.15, "buy" : 6427.15, "sell" : 6427.15, "symbol" : "$"}, + "AUD" : {"15m" : 8790.79, "last" : 8790.79, "buy" : 8790.79, "sell" : 8790.79, "symbol" : "$"}, + "BRL" : {"15m" : 25277.38, "last" : 25277.38, "buy" : 25277.38, "sell" : 25277.38, "symbol" : "R$"}, + "CAD" : {"15m" : 8399.3, "last" : 8399.3, "buy" : 8399.3, "sell" : 8399.3, "symbol" : "$"}, + "CHF" : {"15m" : 6385.05, "last" : 6385.05, "buy" : 6385.05, "sell" : 6385.05, "symbol" : "CHF"}, + "CLP" : {"15m" : 4292375.13, "last" : 4292375.13, "buy" : 4292375.13, "sell" : 4292375.13, "symbol" : "$"}, + "CNY" : {"15m" : 44082.89, "last" : 44082.89, "buy" : 44082.89, "sell" : 44082.89, "symbol" : "¥"}, + "DKK" : {"15m" : 41914.54, "last" : 41914.54, "buy" : 41914.54, "sell" : 41914.54, "symbol" : "kr"}, + "EUR" : {"15m" : 5628.79, "last" : 5628.79, "buy" : 5628.79, "sell" : 5628.79, "symbol" : "€"}, + "GBP" : {"15m" : 5031.26, "last" : 5031.26, "buy" : 5031.26, "sell" : 5031.26, "symbol" : "£"}, + "HKD" : {"15m" : 50451.56, "last" : 50451.56, "buy" : 50451.56, "sell" : 50451.56, "symbol" : "$"}, + "INR" : {"15m" : 448702.8, "last" : 448702.8, "buy" : 448702.8, "sell" : 448702.8, "symbol" : "₹"}, + "ISK" : {"15m" : 696961.02, "last" : 696961.02, "buy" : 696961.02, "sell" : 696961.02, "symbol" : "kr"}, + "JPY" : {"15m" : 712850.89, "last" : 712850.89, "buy" : 712850.89, "sell" : 712850.89, "symbol" : "¥"}, + "KRW" : {"15m" : 7208053.77, "last" : 7208053.77, "buy" : 7208053.77, "sell" : 7208053.77, "symbol" : "₩"}, + "NZD" : {"15m" : 9696.83, "last" : 9696.83, "buy" : 9696.83, "sell" : 9696.83, "symbol" : "$"}, + "PLN" : {"15m" : 24194.07, "last" : 24194.07, "buy" : 24194.07, "sell" : 24194.07, "symbol" : "zł"}, + "RUB" : {"15m" : 432235.78, "last" : 432235.78, "buy" : 432235.78, "sell" : 432235.78, "symbol" : "RUB"}, + "SEK" : {"15m" : 58987.13, "last" : 58987.13, "buy" : 58987.13, "sell" : 58987.13, "symbol" : "kr"}, + "SGD" : {"15m" : 8812.36, "last" : 8812.36, "buy" : 8812.36, "sell" : 8812.36, "symbol" : "$"}, + "THB" : {"15m" : 212144.3, "last" : 212144.3, "buy" : 212144.3, "sell" : 212144.3, "symbol" : "฿"}, + "TWD" : {"15m" : 197782.91, "last" : 197782.91, "buy" : 197782.91, "sell" : 197782.91, "symbol" : "NT$"} +} \ No newline at end of file diff --git a/bin/xchg.buy b/bin/xchg.buy new file mode 100755 index 0000000..a0a3a8a --- /dev/null +++ b/bin/xchg.buy @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +nick=$1 +amount=$2 +target=$3 +source=$4 +if [ "$nick" = "" ];then + echo missing argument for nick + exit 1 +fi +if [ ! -d /var/cache/segfault/xchg/$nick/ ];then + /home/segfault/bin/xchg.init $nick +fi +if [ "$amount" = "" ];then + echo missing argument for amount + exit 1 +fi +if [ "$target" = "" ];then + echo missing argument for target currency + exit 1 +fi +if [ "$source" = "" ];then + echo missing argument for source currency + exit 1 +fi + +rate=1 + +#if [ $target != BTC ];then +# rate2=$(/home/segfault/bin/xchg.getrate $target) +# if [ "$rate2" = "null" ];then +# echo "invalid currency type $target used" +# exit 1 +# fi +# rate=$(echo | awk "{print $rate / $rate2}") +#fi + +#if [ $source != BTC ];then +# rate2=$(/home/segfault/bin/xchg.getrate $source) +# if [ "$rate2" = "null" ];then +# echo "invalid currency type $source used" +# exit 1 +# fi +# rate=$(echo | awk "{print $rate * $rate2}") +#fi + +rate=$(/home/segfault/bin/xchg.getdoublerate $source $target) + +walletsrc=$(cat /var/cache/segfault/xchg/$nick/$source 2>&-) +walletdst=$(cat /var/cache/segfault/xchg/$nick/$target 2>&-) + +if [ "$walletsrc" = "" ];then + walletsrc=0 +fi +if [ "$walletdst" = "" ];then + walletdst=0 +fi + +### if other types of ways of specifying how much are added, remember to set both srcamt and amount. +if [ $amount = "all" ];then + amount="100%" +fi +if grep '%' <<< "$amount" 2>&1 > /dev/null;then + percentage="$(printf "%s\n" "$amount" | tr -cd '0-9.')" + srcamt="$(echo | awk "{print ($percentage / 100) * $walletsrc}")" + amount=$(echo | awk "{print $srcamt / $rate}") +else + srcamt=$(echo | awk "{print $amount * $rate}") +fi + +if [ "$srcamt" = "" ];then + srcamt=0 +fi + +echo trying to buy $amount of $target for $srcamt $source... + + +postwalletsrc=$(echo | awk "{print $walletsrc - $srcamt}") + +if printf "%s\n" $postwalletsrc | grep ^- 2>&1 > /dev/null;then + echo you, $1, would need to have $srcamt $source to buy $amount $target. you only have $walletsrc $source. + exit 1 +fi + +### if we got here we have enough money... guess make the purchase +#echo updating your source wallet... +echo $(echo | awk "{print $walletsrc - $srcamt}") > /var/cache/segfault/xchg/$nick/$source +#echo updating your target wallet... +echo $(echo | awk "{print $walletdst + $amount}") > /var/cache/segfault/xchg/$nick/$target +echo done diff --git a/bin/xchg.getdoublerate b/bin/xchg.getdoublerate new file mode 100755 index 0000000..2a29c8c --- /dev/null +++ b/bin/xchg.getdoublerate @@ -0,0 +1,3 @@ +#!/bin/sh +wget -qO- "https://min-api.cryptocompare.com/data/price?fsym=$2&tsyms=$1" | jq '.["'"$1"'"]' +#/home/segfault/bin/xchg.getrates | jq '.["'"$1"'"].last' diff --git a/bin/xchg.getrate b/bin/xchg.getrate new file mode 100755 index 0000000..b545667 --- /dev/null +++ b/bin/xchg.getrate @@ -0,0 +1,3 @@ +#!/bin/sh +wget -qO- "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=$1" | jq '.["'"$1"'"]' +#/home/segfault/bin/xchg.getrates | jq '.["'"$1"'"].last' diff --git a/bin/xchg.getrates b/bin/xchg.getrates new file mode 100755 index 0000000..3a73af2 --- /dev/null +++ b/bin/xchg.getrates @@ -0,0 +1,3 @@ +#!/bin/sh +#cat /home/segfault/bin/rates +wget -qO- https://blockchain.info/ticker diff --git a/bin/xchg.give b/bin/xchg.give new file mode 100755 index 0000000..11f6158 --- /dev/null +++ b/bin/xchg.give @@ -0,0 +1,90 @@ +#!/usr/bin/env bash +nick=$1 +amount=$2 +type=$3 +dstnick=$4 +if [ "$nick" = "" ];then + echo missing argument for nick + exit 1 +fi +if [ ! -d /var/cache/segfault/xchg/$nick/ ];then + /home/segfault/bin/xchg.init $nick +fi +if [ "$amount" = "" ];then + echo missing argument for amount + exit 1 +fi +if [ "$type" = "" ];then + echo missing argument for type of currency + exit 1 +fi +if [ "$dstnick" = "" ];then + echo missing argument for who is to receive the money + exit 1 +fi + +rate=1 + +#if [ $target != BTC ];then +# rate2=$(/home/segfault/bin/xchg.getrate $target) +# if [ "$rate2" = "null" ];then +# echo "invalid currency type $target used" +# exit 1 +# fi +# rate=$(echo | awk "{print $rate / $rate2}") +#fi + +#if [ $source != BTC ];then +# rate2=$(/home/segfault/bin/xchg.getrate $source) +# if [ "$rate2" = "null" ];then +# echo "invalid currency type $source used" +# exit 1 +# fi +# rate=$(echo | awk "{print $rate * $rate2}") +#fi + +#rate=$(/home/segfault/bin/xchg.getdoublerate $source $target) +rate=1 + +walletsrc=$(cat /var/cache/segfault/xchg/$nick/$type 2>&-) +walletdst=$(cat /var/cache/segfault/xchg/$dstnick/$type 2>&-) + +if [ "$walletsrc" = "" ];then + walletsrc=0 +fi +if [ "$walletdst" = "" ];then + walletdst=0 +fi + +### if other types of ways of specifying how much are added, remember to set both srcamt and amount. +if [ $amount = "all" ];then + amount="100%" +fi +if grep '%' <<< "$amount" 2>&1 > /dev/null;then + percentage="$(printf "%s\n" "$amount" | tr -cd '0-9.')" + srcamt="$(echo | awk "{print ($percentage / 100) * $walletsrc}")" + amount=$srcamt +else + srcamt=$amount +fi + +if [ "$srcamt" = "" ];then + srcamt=0 +fi + +echo trying to give $srcamt $type to $dstnick... + + +postwalletsrc=$(echo | awk "{print $walletsrc - $srcamt}") + +if printf "%s\n" $postwalletsrc | grep ^- 2>&1 > /dev/null;then + echo you, $1, would need to have $srcamt $source to give $amount $type to $dstnick. you only have $walletsrc $source. + exit 1 +fi + +### if we got here we have enough money... guess make the purchase +#echo updating your source wallet... +echo $(echo | awk "{print $walletsrc - $srcamt}") > /var/cache/segfault/xchg/$nick/$type +#echo updating your target wallet... +echo $(echo | awk "{print $walletdst + $amount}") > /var/cache/segfault/xchg/$dstnick/$type +echo done diff --git a/bin/xchg.help b/bin/xchg.help new file mode 100644 index 0000000..fb40ba8 --- /dev/null +++ b/bin/xchg.help @@ -0,0 +1,10 @@ + $list Shows how many coin you have + $buy [amount] [what_you_want] [what_you_dont] + I think of it like: xchg, I want to buy 100 bitcoins with US dollars. + example: $but 100 BTC USD + $sell [amount] [what_you_want] [what_you_dont] + $give [amount] [type] [their_nick] + I think of this one like: xchg, I want to give 100 bitcoins to my_bro + example: $give 20 ETH epoch + amounts can also be percentages or "all" which just gets turned into 100% + these percentages are based on the amount of money of the type that is being spent. diff --git a/bin/xchg.init b/bin/xchg.init new file mode 100755 index 0000000..b449ba7 --- /dev/null +++ b/bin/xchg.init @@ -0,0 +1,4 @@ +#!/bin/sh +rm -r /var/cache/segfault/xchg/$1 2>/dev/null +mkdir -p /var/cache/segfault/xchg/$1 +echo 1000 > /var/cache/segfault/xchg/$1/BTC diff --git a/bin/xchg.list b/bin/xchg.list new file mode 100755 index 0000000..cad49f4 --- /dev/null +++ b/bin/xchg.list @@ -0,0 +1,5 @@ +#!/bin/sh +if [ ! -d /var/cache/segfault/xchg/$1 ];then + /home/segfault/bin/xchg.init $1 +fi +grep -H . /var/cache/segfault/xchg/$1/* | grep -v ':0$' | cut -d/ -f6- diff --git a/files/useraliases b/files/useraliases index beb5b6a..1729119 100644 --- a/files/useraliases +++ b/files/useraliases @@ -1,6 +1,6 @@ !alias !savealias !leetappend %~/files/useraliases 10 !alias %s !alias !reload !raw quit :reload -!alias !addlink !leetappend /var/www/sites/hacking/links.txt 10 %s (~%n) +!alias !addlink !leetappend /var/www/sites/hacking/links.txt 10 %s (~%n @ %t) !alias !more !tailunlock %~/files/cmd_out !alias !shmore !tailunlock %~/files/sh_out !alias !ping !say pong @@ -20,8 +20,8 @@ !alias !reeval !eval %~/files/useraliases ######### the todo shit ######### -!alias !todo !c cat -n '/var/todo/%n.txt' | shuffle -f-| head -n1 -!alias !todo.add !leetappend '/var/todo/%n.txt' 10 '%q' +!alias !todo !c cat -n '/var/todo/%n.txt' | grep '%q' | shuffle -f-| head -n1 | tee '/var/todo/%n.current' +!alias !todo.add !leetappend /var/todo/%n.txt 10 "%s" !alias !todo.claim !c ln '/var/todo/%q.txt' '/var/todo/%n.txt' !alias !todo.get !c head -n '%q' '/var/todo/%n.txt' | tail -n1 !alias !todo.grep !c cat -n '/var/todo/%n.txt' | grep -i '%q' @@ -32,7 +32,10 @@ There's a real tab right.... v-- there. !alias !todo.n !todo.grep ^ *%s !alias !todo.rm !c rmln '%q' '/var/todo/%n.txt' -!alias !todo.who !c ls -i /var/todo | sort | clump +!alias !todo.who !c ls -i /var/todo | grep -v '\.current$' | sort | clump +!alias !todo.current !cat /var/todo/%n.current +!alias !todo.last !c nl '/var/todo/%n.txt' | tail -n1 +!alias !todo.page !page todo&user=%n ########## the end of that shit ######### ########## the useraliases shit ######### @@ -47,11 +50,11 @@ ########## the end of taht shit ######### !alias !tmplink !c echo '' > /var/www/sites/hacking/tmplink.html -!alias !links !c if [ '_%q' != '_' ];then grep -i '%q' /var/www/sites/hacking/links.txt;else echo http://"$(rdns "$(hop0 '%h')")"/cgi-bin/links.cgi;fi +!alias !links !c if [ '_%q' != '_' ];then grep -i '%q' /var/www/sites/hacking/links.txt | sed 's/^/ /';else echo http://"$(rdns "$(hop0 '%h')")"/cgi-bin/links.cgi;fi !alias !tits !say [ . | . ] !alias !geo !c whob '%q' | egrep "^Country:|^City" !alias !dcc !rc p="$[45000 + ($RANDOM % 20000)]";echo -e 'privmsg %n :\x01DCC SEND '"$(basename '%q')" "$(dcchelper $(gethostbyname %h))" "$p" "$(wc -c '%q'|tr -s ' '|cut '-d ' -f2)\x01";ncat -l -p "$p" < '%q' -!alias !title !c wget --no-check-certificate -qO- '%q' | tr '>' '\n' | XuntilY "' '\n' | XuntilY " -f7 | cut -d\< -f1 +!alias !you !c /home/segfault/chat/chat.sh you '%q' +!alias !cccode !c grep '^%q' /usr/local/share/misc/countrycallcodes +!alias !whatis !c whatis '%q' +!alias !links.dicks !c sed 's/.*(~//' /var/www/sites/hacking/links.txt | sort | uniq -c +!alias !coffee !say I'm not your fuckin' slave! I don't even have hands! +!alias !btc-usd !c wget -qO- https://blockchain.info/ticker | jq '.USD["last"]' +!alias !page !say http://hacking.allowed.org/cgi-bin/pageview.cgi?page=%s +!alias !ohshit !linelimit 1 +!alias !dnsflush !c /home/segfault/programs/dnsflush +!alias !kitteh !cat /anarchy/ascii-art/kitteh +!alias !ssyahoo !c wget -qO- "http://ff.search.yahoo.com/gossip?output=fxjson&command=$(printf '%%s' '%q' | vis -h)" | jq .[1][0] +!alias !319 !c printf '%%s' '%q' | cut -d: -f3- | tr ' ' '\n' | sort > /home/segfault/tmp/channels_%3 +!alias !chandiff !c diff /home/segfault/tmp/channels_{%0,%1} | grep '^[<>]' | sort +!alias !unshorten !c unshorten.sh '%q' +!alias !chandunno !rc printf "PRIVMSG %s :_ _\nPRIVMSG %s : \\O_o/\n" +!alias !DATE !rc printf 'notice %f :\x01DATE %%s\x01\n' "$(date)" +!alias !title_noua !c wget --user-agent="" -qO- '%q' | tr '>' '\n' | XuntilY "]*>//g" | tr -d '\n' | decode_html_entities +!alias !readtwit2 !c wget -qO- '%q' | tr '<' '\n' | awk '/^div class="js-tweet-text-container"/,/\/div/' | sed "s/^[^>]*>//g" | tr -d '\n' | decode_html_entities +!alias !checkcerts !c printf 'QUIT :derp\r\n' | openssl s_client -connect %s 2>&1 | openssl x509 -noout -subject -dates +!alias !ptythis !sh python -c 'import pty;pty.spawn("'%s'")' +!alias Who !say your mother. +!alias who !say your mother. +!alias !addnote !leetappend /var/www/sites/hacking/docs/writing/%n_notes.txt 10 %s +!alias \o/ !say Well fuck you mate +!alias !msg !c printf '%%s' "$(printf '%%s' '%q' | cut '-d ' -f2-)" > /anarchy/msg/"$(printf '%%s' '%q' | cut '-d ' -f1)" +!alias ;SEND !c ncat -i 10 $(gethostbyname %1) %2 > /anarchy/segfault_dccin/%0 +!alias ;DCC lambda %s +!alias !spam !rc for i in $(seq 1 1000);do echo -e "nick Derp$i\nprivmsg %q :YOU GOT FUCKED SON";done +!alias s !c cat /home/segfault/files/log | tac | tail -n+5 | sed -n 's/%sp' | head -n1 +!alias !quest.rm !c rmln '%q' '/var/todo/quests.txt' +!alias !quest.add !leetappend /var/todo/quests.txt 10 "%s" (~%n) +!alias !quest !c cat -n '/var/todo/quests.txt' | shuffle -f- | head -n1 | tee '/var/todo/%n.current' +!alias which !c printf '%%s\n' '%q' | grep ': ' | cut -d: -f2- | sed "s/, or /,/g" | tr -d '?' | tr ',' '\n' | grep . | shuffle -f- | head -n1 | sed 's/^ *//g;s/ *$//g' +!alias !fight !raw kill %n :no fighting +!alias ;KICK !raw kill %n :weapons escalation! +!alias $toke !say whoops wrong channel xD +!alias !source !say git://armitage.hacking.allowed.org/segfault +!alias !sauce !source +!alias ping? !say pong? +!alias ping. !say pong. +!alias ping !say pong +!alias which: which : %s +!alias !listenbitch! !say it wasn't Obama's fault +!alias !Weather !c curl -s -q -4 'http://wttr.in/%q' | head -n 7 +!alias !synop !c man -h '%q' 2>&- | perl -pe 's/.\x08//g' +!alias !topn !c top | head -n $[7+%0] | tail -n$[%0+1] +!alias !coffee !say o/ +!alias !btc-balance !c wget -qO- https://blockchain.info/q/addressbalance/%s +!alias !btc-balance !ec echo '!satoshi2btc' "$(wget -qO- https://blockchain.info/q/addressbalance/%s)" +!alias !satoshi2btc !c printf '%%d.%%08d\n' "$(echo '%s' | rev | cut -b9- | rev)" "$(echo '%s' | rev | cut -b-8 | rev)" +!alias !localtime !date epoch +!alias !reddit !c curl -sA "Mozilla Firefux" 'https://www.reddit.com/r/%q/.rss' | tr '<' '\n' | XuntilY '^entry' '^/entry' 999 | XuntilY '^title' '^/title' 999 | tr '>' '\n' | grep -v '^title' | grep -v '^/title' | grep . | head -n 5 | decode_html_entities +!alias !magic-check lambda !say %%%%%0 = %%%s +!alias !python !c python -c '%q' +!alias !ted !c cd /home/epoch/projects/markov ; ./markov.sh +!alias !ted !c cd /home/epoch/projects/markov ; ./markov.sh | tac | tac +!alias !bots !me is a bot +!alias !cycle !rc printf 'PART %f\nJOIN %f' +!alias are !yesno +!alias is !yesno +!alias right? !xory right! or wrong! + !alias sup? !c wget -qO- http://news.ycombinator.com/rss | xml sel -t -v '//item/title|//item/link' | head -n2 +!alias !nowplaying !c wget -qO- http://radio.zempirians.com/current.php +!alias !dnsamp !c dig -t ANY '%q' | tail -n2 | cut -d: -f2- +!alias !dnsamp !c dig -t ANY '%q' | tail -n2 | cut -d: -f2- ; printf "%%s\n" '%q' +!alias !epochplaying !c cat /proc/$(pgrep mpg123)/cmdline | tr '\0' '\t' | cut -f2 +!alias orly? ORLY. + !alias ;QUIT !rc if [ '%q' = 'QUIT Ping timeout: 120 seconds' ];then echo "kline *!%u@%h 3600 :autoban for pingout. use other server or wait an hour.";else echo "PRIVMSG #default :*!%u@%h" for '%q';fi +!alias can !yesno +!alias how? !say fuck if I know. I'm just a bot. +!alias could !yesno +!alias !rr !rc mkdir -p /tmp/rr;cd /tmp/rr ; cat <(seq 1 6) <(ls /tmp/rr) | sort | uniq -u | shuffle -f- | head -n1 | tee /dev/stderr | xargs touch ; if [ -e /tmp/rr/6 ] ;then echo 'kill %n :you just painted the walls with your brains'; rm /tmp/rr/* ; else echo 'privmsg %f :wew' ; fi +!alias !lastdaysincelifedamngood !say 0 +!alias !howmanyfucks !say 0 +!alias howmany which : all, none, few, many, some? +!alias how !leetappend /home/segfault/files/eval 10 how%s +!alias !dicksize !c dicksize '%q' +!alias s !c cat /home/segfault/files/log | tac | tail -n+2 | sed -n 's/%sp' | head -n1 +!alias Should !yesno +!alias does !yesno +!alias do !yesno +!alias orly? !yesno +!alias !myip !c dig +short ns2.allowed.org @ns1.afraid.org +!alias !temp !c envstat | tail -n1 | tr -s ' ' | cut '-d ' -f4 | cut -d. -f1 +!alias echo $RANDOM +!alias !quest.grep !c grep -ni '%q' '/var/todo/quests.txt' +!alias what? !rc atrm $(atq | tail -n1 | tr -s ' ' | cut '-d ' -f5);echo 'echo '\''!raw kill %n :what?'\'' > /home/segfault/files/eval' | at +5minutes ; echo 'PRIVMSG %f :you have 5 minutes to get rid of that word.' +!alias !chain !leetappend /home/segfault/files/eval 10 %s +!alias keep_talking_shit !say is that a command? +!alias brb !c date +%%s > '/var/cache/segfault/brb/%n';echo "I will count the seconds until your return." +!alias back !c if [ -f '/var/cache/segfault/brb/%n' ];then echo "you were gone for" $[$(date +%%s) - $(cat '/var/cache/segfault/brb/%n')] "seconds";rm '/var/cache/segfault/brb/%n';fi +!alias i_love_SegFault !say <3 +!alias i_love !chain i_love_%s +!alias i !chain i_%s +!alias was !yesno +!alias hack_the_planet !c cat /anarchy/ascii-art/epoch/hands/fist ; echo 'HACK THE PLANET!' +!alias !whogone !c cd /var/cache/segfault/brb/; echo * + +!alias $init !c /home/segfault/bin/xchg.init %n +!alias $list !c /home/segfault/bin/xchg.list %n +!alias $buy !c /home/segfault/bin/xchg.buy %n %s +!alias $sell $buy -%s +!alias $getprice !c wget -qO- 'https://min-api.cryptocompare.com/data/price?fsym=%0&tsyms=%1' | jq '.["%1"]' | xargs printf "1 %0 is worth %%s %1" + +!alias keep_talking !chain keep_talking_%s +!alias keep !chain keep_%s +!alias hack !chain hack_%s +!alias hack_the !chain hack_the_%s +!alias did !yesno +!alias have !yesno +!alias beep !say boop +!alias boop !say beep +!alias !btc-usd !c curl -s https://blockchain.info/ticker | jq '.USD["last"]' +!alias !ted !c cd /home/epoch/projects/markov/ ; ./markov.sh sauce | tac +!alias !ug !c cd /home/epoch/projects/markov/ ; ./markov.sh sauce_underground | tac +!alias !markov !c cd /home/epoch/projects/markov/ ; ./markov.sh %s | tac +!alias hi !c printf "%s\n" '%q' | grep '%m' 2>&1 >/dev/null && echo "Hi." +!alias what_is !c grep -A1 '^'"$(printf "%s\n" '%q' | sed 's/\?$//')"'$' /home/segfault/files/what | sed -n 'n;p' | fold -s -w 300 +!alias what !chain what_%s +!alias know !chain know_%s +!alias know_that !c printf '%%s\n' '%q' | sed -E 's/ is | are /\'$'\n''/' >> /home/segfault/files/what +!alias what_are what_is %s +!alias what's what_is %s +!alias $help !cat /home/segfault/bin/xchg.help +!alias $give !c /home/segfault/bin/xchg.give %n %s +!alias $price $getprice %s +!alias when which : soon, after a while, eventually, never, recently, while ago, long time ago +!alias !vol !c mixerctl -w outputs.headphones%s diff --git a/scripts/command b/scripts/command index 538a09e..aa8b861 100644 --- a/scripts/command +++ b/scripts/command @@ -1,3 +1,3 @@ -!istaillocked %~/files/cmd_out Try using !more +!istaillocked %~/files/cmd_out Try using !more or !hardreset if you want to discard the output. !changetail %~/files/cmd_out %f 56 !leetappend %~/files/cmd_in 10 %s diff --git a/scripts/cowsay.lua b/scripts/cowsay.lua index 6f0588e..5d9a80d 100644 --- a/scripts/cowsay.lua +++ b/scripts/cowsay.lua @@ -50,6 +50,27 @@ end function ascii_pc( pccmd ) end +function ascii_dickbutt( name ) + local s = "" + if name == nul then name = "" else + name = "("..name..")\n" end + s = s .. [[ + ___ +/ \ <--- ]] .. name .. [[ +|o o| +| > | +|__/| /\ +| |_ || +| | \|| +| J )_) + \____/ + | + =' +]] + return s +end + +v="help" for k,v in ipairs(arg) do if v == "nerd" then print( ascii_nerd( arg[k+1] ) ) @@ -57,5 +78,10 @@ for k,v in ipairs(arg) do print( ascii_goat( arg[k+1] ) ) elseif v == "shoot" then print( ascii_shoot( arg[k+1] ) ) + elseif v == "dickbutt" then + print( ascii_dickbutt( arg[k+1] ) ) end end +--if v == "help" then +-- print("usage: sayp [nerd|goat|shoot|dickbutt] [name]") +--end diff --git a/scripts/drink.sh b/scripts/drink.sh new file mode 100755 index 0000000..b36382e --- /dev/null +++ b/scripts/drink.sh @@ -0,0 +1,5 @@ +#!/bin/bash +export SHELL=/bin/bash +$(exit $[$RANDOM % 50]) && printf "\x01ACTION sees that it is %s passed the hour and takes a shot of tripwire.\x01\n" "$(date +%M)" > /home/segfault/files/default +#$(exit $[$RANDOM % 50]) && printf "\x01ACTION sees that it is %s passed the hour and shoots a few ccs of heroin.\x01\n" "$(date +%M)" > /home/segfault/files/default +exit 0 diff --git a/scripts/listtofile b/scripts/listtofile new file mode 100644 index 0000000..48b3fce --- /dev/null +++ b/scripts/listtofile @@ -0,0 +1,4 @@ +!alias !323 !alias !332 _ +!alias !332 !leetappend /tmp/channels 10 %s +!c > /tmp/channels +!raw LIST diff --git a/scripts/prestartup b/scripts/prestartup index 16054f0..396673a 100644 --- a/scripts/prestartup +++ b/scripts/prestartup @@ -1,12 +1,12 @@ Set important server message handlers first. 004 is where we know we're connected and can start joining shit. -!alias !eval !leettail 150%s -!alias !004 !eval %~/scripts/startup +!alias !Eval !leettail 022%s +!alias !004 !Eval %~/scripts/startup 436 is nick collision. -!alias !433 !nick %m%r%r%r -!alias !436 !nick %m%r%r%r +!alias !433 !nick %m%r +!alias !436 !nick %m%r !nick SegFault !raw user epoch epoch epoch :epoch - - !raw PASS wrongpassword - !raw SERVER nope.segfault.allowed.org :testing +!alias !Evalhome !leettail 022%~/%s +!linelimit a +!Evalhome files/useraliases diff --git a/scripts/shell b/scripts/shell index 28db4ee..7383125 100644 --- a/scripts/shell +++ b/scripts/shell @@ -1,3 +1,3 @@ -!more +!istaillocked %~/files/sh_out Try using !shmore !changetail %~/files/sh_out %f 56 !leetappend %~/files/sh_in 10 %s diff --git a/scripts/startup b/scripts/startup index 21ed886..d88e5d2 100644 --- a/scripts/startup +++ b/scripts/startup @@ -1,23 +1,24 @@ !linelimit 10000 !raw oper g0d WAFFLEIRON +lambda !raw mode %m +F !raw join #cmd -!alias !eval !leettail 150%%s -!alias !rc !eval %~/scripts/rawcommand %%s -!alias !ec !eval %~/scripts/evalcommand %%s -!alias !c !eval %~/scripts/command %%s -!alias !sh !eval %~/scripts/shell %%s -!leettail 56#cmd:%~/files/cmd_out -!leettail 56#cmd:%~/files/sh_out +!alias !eval !leettail 150%s +!alias !rc !eval %~/scripts/rawcommand %s +!alias !ec !eval %~/scripts/evalcommand %s +!alias !c !eval /home/segfault/scripts/command %s +!alias !sh !eval %~/scripts/shell %s +!alias !pipetailhome !leettail 56#default:%~/%s +!alias !pipetailhome2 !leettail 56#cmd:%~/%s +!alias !tail !leettail 08%s +!alias !tailhome !tail #default:%~/%s +#!tail files/cmd_out +#!tail files/sh_out +!pipetailhome files/cmd_out +!pipetailhome files/sh_out +!pipetailhome files/default +!leettail 56#cmd:/home/segfault/files/PMepoch +!changetail /home/segfault/files/PMepoch epoch 56 +!leettail 18#default:/home/segfault/files/eval +!pipetailhome2 files/cmd !raw join #default - -!alias !tail !leettail 08%%s - -#top one joins too. - !alias !taildir !ec find %%s -type f | while read i;do c='#'$(basename $(dirname "$i"))'-'$(basename "$i");echo '!leettail 08'${c}':'"$i";echo '!raw JOIN '$c;echo '!raw TOPIC '$c' :'$c;done - !alias !taildir !ec find %%s -type f | while read i;do c='#'$(basename $(dirname "$i"))'-'$(basename "$i");echo '!leettail 08'${c}':'"$i";echo '!raw TOPIC '$c' :'$c;done -#!alias !taildir !c find %%s -type f | while read i;do c='#'$(basename $(dirname "$i"))'-'$(basename "$i");echo '!leettail 08'${c}':'"$i";echo '!raw TOPIC '$c' :'$c;done > /service/log2irc/scripts/taildir;echo '!lobotomy' >> /service/log2irc/scripts/taildir -!alias !taildir !c find %%s -type f | while read i;do c='#'$(basename $(dirname "$i"))'-'$(basename "$i");echo '!leettail 08'${c}':'"$i";echo '!raw TOPIC '$c' :'$c;done > /service/log2irc/scripts/taildir -!taildir /var/log/toirc/ -!tail #default:%~/files/default - -!eval %~/files/useraliases +!raw join #xchg -- cgit v1.2.3