Skip to content

Instantly share code, notes, and snippets.

View haniawni's full-sized avatar

Hani Awni haniawni

View GitHub Profile
import glob, subprocess
def run_command(command): # found this on stackoverflow
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
return iter(p.stdout.readline, b'')
iFiles = glob.glob("/var/log/apt/history.log*")
iFiles.sort(reverse=True) # to get the files in date order but not really critical
for f in iFiles:
command = ['zcat', '-f', f]
@haniawni
haniawni / rustc died
Last active March 11, 2018 22:11
rustc bug report 2018/03/11
➜ GSD git:(master) ✗ RUST_BACKTRACE=1 cargo run --verbose
Fresh lazy_static v0.2.11
Fresh httparse v1.2.4
Fresh unicode-xid v0.0.4
Fresh libc v0.2.36
Fresh traitobject v0.1.0
Fresh scopeguard v0.3.3
Fresh untrusted v0.5.1
Fresh safemem v0.2.0
Fresh glob v0.2.11
@haniawni
haniawni / shell output when generating migration
Created November 28, 2016 19:45
Ruby problems when devving for cantino/huginn
jimbobjoliene git:(master) bin/rails generate migration AddSharedMemoryToScenarios
/Users/hawni/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require': dlopen(/Users/hawni/.rvm/gems/ruby-2.3.3/gems/mysql2-0.3.20/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/hawni/.rvm/gems/ruby-2.3.3/gems/mysql2-0.3.20/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/hawni/.rvm/gems/ruby-2.3.3/gems/mysql2-0.3.20/lib/mysql2/mysql2.bundle
from /Users/hawni/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/hawni/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/hawni/.rvm/gems/ruby-2.3.3/gems/activesupport-5.0.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/hawni/.rvm/gems/ruby-2.3.3/gems/mysql2-0.3.20/lib/mysql2.rb:31:in `<top (required)>'
from
pys = require('python-shell');
sl = require('sleep');
var s = new pys('testStdIn.py');
s.on('message',function(message){
console.log('stdOut: '+ message);
});
s.on('error',function(message){
console.log('stdErr: '+ message);
});