Skip to content

Instantly share code, notes, and snippets.

View kochd's full-sized avatar

Daniel Koch kochd

View GitHub Profile
uri = URI.parse(ARGV[0])
# 1.) Retrieve a pow
# GET request to http://albion-online-data.com:4223/pow returns JSON data:
# {"wanted":"01100001001100110110010100110001001100","key":"4e8d1a"}
response = Net::HTTP.get(uri.host, '/pow', uri.port)
pow = JSON.parse(response)
# 2.) Solve the pow
# The client has to guess the solution by generating random hexadicimal strings
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 7 2700X Eight-Core Processor
CPU Family: 0x17
@kochd
kochd / foo.rb
Created February 26, 2016 14:23
loop do
length = rand(1..(1024**3))
puts "Writing #{length} bytes"
data = Random.new.bytes(length)
file = "rand_data_#{SecureRandom.hex(32)}"
File.open(file, "w") { |f| f.write data}
a = Digest::SHA512.hexdigest(File.read(file))
b = Digest::SHA512.hexdigest(data)
require 'json'
require 'net/https'
stats = Hash.new(0)
nodes = JSON.parse(Net::HTTP.get(URI("https://map.luebeck.freifunk.net/nodes.json")))["nodes"]
nodes.each{ |a| stats["clients"] += a["clientcount"].to_i }
stats["nodes"] = nodes.select{ |a| a["flags"]["online"] && !a["flags"]["gateway"] }.count
puts stats.to_json
require 'json'
require 'net/https'
stats = Hash.new(0)
nodes = JSON.parse(Net::HTTP.get(URI("https://map.luebeck.freifunk.net/nodes.json")))["nodes"]
nodes.each{ |a| stats["clients"] += a["clientcount"].to_i }
stats["nodes"] = nodes.count
puts stats
#!/bin/bash
status=/var/lib/dpkg/status
if grep jockey-common $status >/dev/null 2>&1 # if was installed someday or currently is
then
sed -i 'N; s/Package: jockey-common.*/Package: jockey-common\nStatus: install ok installed/' $status # Claim that it is
else # If it is not even there append to status
echo "
Package: jockey-common
Status: install ok installed
tar xavf entpackt alle außer unzip ;)
Aus der Manpage:
" -a, --auto-compress
Die Archiv-Endung verwenden, um das Kompressionsprogramm herauszufinden
"
DefVar $ExitCode$
DefVar $INST_SystemType$
DefVar $INST_architecture$
DefVar $Inst_Cmd$
DefVar $Inst_Prg$
DefVar $InstallDir$
DefVar $LicenseKey$
DefVar $LicensePool$
DefVar $LicenseRequired$
DefVar $LogDir$
[Initial]
SetLogLevel=9
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
[Initial]
SetLogLevel=9
; Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false