Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# Required ubuntu packages: libnotify1
# required gems: json, libnotify from http://github.com/splattael/libnotify
# required file: web_socket.rb from http://github.com/gimite/web-socket-ruby/blob/master/lib/web_socket.rb
HOST="localhost" # The host where diaspora is running
WSPORT=8080 # Websocket port
USERID="xxxxxxxxxxxxxxxxxxxxxxx" # Your userid (the one you see in the adress bar when clicking edit profile)
REGISTERED_PATH="/" # Can be a path to a specific aspect or / for all
ICON_PATH=File.join(File.dirname(__FILE__), "icons")
@xorrizon
xorrizon / android-uninstall.rb
Created February 5, 2013 21:16
A little uninstall script I wrote to uninstall android apps via adb
#!/usr/bin/env ruby
def get_packages(prefix)
pkgs = []
s = `adb shell pm list packages #{prefix}`
s.each_line do |line|
next unless line.start_with?("package:")
pkgs << line.split(":")[1]
end
pkgs
@xorrizon
xorrizon / stream_fullscreen.sh
Created September 27, 2013 19:40
Bash script for twitch streaming with ffmpeg. Also uses offset to use my 2nd monitor
#!/bin/bash
API_KEY="live_XXX"
FPS="30"
#INRES="1920x1200"
INRES="1920x1080"
OUTRES="$INRES"
#OUTRES="640x400"
#OFFSET="+0,0"
OFFSET="+1600,0" # use xwininfo to get
@xorrizon
xorrizon / jenkins LayoutBug Workaroound
Last active August 29, 2015 14:04
Workaround for the current Jenkins Layout bug
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("jenkins.catrob.at") {
.col-md-3 {
width: 20%;
}
}
diff --git a/Paintroid/adb_tasks.gradle b/Paintroid/adb_tasks.gradle
index 0937600..1f0a3f2 100644
--- a/Paintroid/adb_tasks.gradle
+++ b/Paintroid/adb_tasks.gradle
@@ -44,7 +44,7 @@ def executeShellCommand(command) {
def createAdbInstallTask(variant) {
task ("commandlineAdbInstall${variant.name.capitalize()}") << {
- def command = [getAdb(), '-s', getAndroidDevice(), 'install', variant.packageApplication.outputFile.path]
+ def command = [getAdb(), '-s', getAndroidDevice(), 'install', variant.outputs[0].outputFile.path]
@xorrizon
xorrizon / cert.rb
Last active August 29, 2015 14:15 — forked from ricardochimal/cert.rb
#!/usr/bin/env ruby
domain = "localhost"
organisation = "example"
country = "AT"
subjectAltDomains = [
"DNS:#{domain}",
"DNS:localhost.localdomain",
"IP:127.0.0.1",
"IP:10.0.2.2"
#! /bin/bash
# Kill processes orphaned by Jenkins
# Work around Java's use of SIGTERM rather than SIGKILL and
# Jenkins's lack of any workaroud in the box.
# here is the relevant bug:
# https://issues.jenkins-ci.org/browse/JENKINS-17116
# Suggested usage:
@xorrizon
xorrizon / 7dtdMapRender.rb
Created January 13, 2016 12:26
Script to render maptiles created from allocs server fixes
#!/usr/bin/env ruby
unless ARGV.count == 1
puts "USAGE: #{File.basename($0)} path/to/map/tile/dir/zoomLevel"
puts "Example: #{File.basename($0)} /home/sdtd/instances/myServer/Random Gen/mySeed/map/4"
exit 0
end
path = File.expand_path ARGV[0]
puts path