Skip to content

Instantly share code, notes, and snippets.

@usure
usure / cTwit.sh
Created October 26, 2011 22:53
cmus twitter bash script
#cmus and ttytter must be installed
#Full twitter intergration coming soon to script. (No need for ttytter)
PROGRAM='cmus'
#DIRECTORY="$HOME/log"
if ps ax | grep -v grep | grep $PROGRAM > /dev/null
then
echo "CMUS is running"
else
echo "cmus is not running! Start cmus and then try again."
exit 1
@usure
usure / irx.sh
Created October 28, 2011 00:42
SystemMonitor BASH
#!/bin/bash
############# SYSTEM MONITOR ######################
#Made by Gregory12z
#UNFINISHED. Only shows minimal info. ALSO... Next version will use ncurses.
#Enjoy.
#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 3 of the License, or
#(at your option) any later version.
@usure
usure / cTwitx.sh
Created October 30, 2011 19:33
cmusTweeter
#!/bin/bash
#Twitter tweeter by http://360percents.com
#v1.1 on May 12th 2011
#Edited by TheShadowFog
PROGRAM='cmus'
#DIRECTORY="$HOME/log"
username="email"
password="password"
@usure
usure / gist:2312591
Created April 5, 2012 17:14
4chan thread archiver
#!/bin/bash
$tnumbertnumber=`echo $1 | cut -c32-`
mkdir $tnumber
cd $tnumber
while :
do
wget -e robots=off -E -nd -nc -np -r -k -H -D images.4chan.org,thumbs.4chan.org $1
cp $tnumber.html index.html
sleep 10
done
require 'isaac'
require 'lastfm'
api_key = "api_keyhere"
api_secret = "api_secret here"
lastfm = Lastfm.new(api_key, api_secret)
token = lastfm.auth.get_token
#puts api_key
#puts token
puts "http://www.last.fm/api/auth/?api_key=#{api_key}&token=#{token}"
sleep 10.0
@usure
usure / random imgur
Created July 3, 2012 18:00
random imgur
require 'net/http'
require 'uri'
def isLive?(url)
uri = URI.parse(url)
response = nil
Net::HTTP.start(uri.host, uri.port) { |http|
response = http.head(uri.path.size > 0 ? uri.path : "/")
}
return response.code == "200"
@usure
usure / test
Created July 18, 2012 23:57
test
test
@usure
usure / 4dl
Last active October 12, 2015 10:27
4chan thread archiver (UPDATED)
#!/bin/bash
[[ $1 =~ .*org* ]] && \
#thread=`echo $1 | cut -c25-`
thread=`echo $1 | sed "s/4chan.org//g" | sed "s/[^0-9]//g;s/^$/-1/;"`
echo $thread
echo "BOARD?"
read board
cd $board
mkdir $thread
@usure
usure / index.haml
Created April 5, 2013 23:57
A CodePen by Greg. REEDR
!!! 5
%title = "APP"
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
#header
APP
#menu
<br>
%a{:href => "/"} HOME
|
@usure
usure / fib.rb
Created October 22, 2013 13:12
Fibonacci sequence in ruby
a = [1,2]
for i in 0..10
a.push(a[-1] + a[-2])
end
puts a