Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan VerWeire wankdanker

View GitHub Profile
@wankdanker
wankdanker / mkunpriv.sh
Last active Apr 1, 2020
A script to make Proxmox LXC Containers unprivileged
View mkunpriv.sh
#!/bin/bash
##
## Warning: do not use this unless you understand and agree with what it does
##
## Based on: https://forum.proxmox.com/threads/convert-privileged-to-unprivileged-container.31066/#post-261883
##
## NOT HANDLED
## * multiple disks
## * if there are backup/snapshot references in the lxc/$vmid.conf the unprivileged:1 will be added to the end of the file and in a backup config not in the active config, that can break the first boot
## * setuid and setgid permissions are not retained
@wankdanker
wankdanker / README.md
Last active Oct 31, 2019
Walmart Drop Ship Vendor Supplier DSV Carrier Method Codes
View README.md

Walmart Drop Ship Vendor Supplier DSV Carrier Method Codes

As part of the Walmart DSV API, there are carrier method codes in the order xml, but the only documentation I found was in this PDF. That document is referenced from Supplier Help.

That PDF file is of course not easily consumable and it was a wicked pain in the ass to get the data out of there. But, it's done now, and if you happen to find this file I hope I saved you some time.

@wankdanker
wankdanker / README.md
Last active Dec 14, 2015
Generate a mac address based on FQDN
View README.md

Install

curl https://gist.githubusercontent.com/wankdanker/2f676cc85f52fd471567/raw -o /usr/local/bin/gen-mac; chmod 755 /usr/local/bin/gen-mac
@wankdanker
wankdanker / install.md
Last active Aug 29, 2015
Installing kdev-qmljs (JavaScript/Nodejs Code Completion) for kdevelop on Ubuntu 14.04
View install.md

This is what I had to do in order to get code completion for node.js to work with kdevelop on Ubuntu 14.04.

I have not run through these steps again on a fresh system so, I'm not sure if I'm missing anything here. If you find something missing please let me know.

#enable the backports repository to get kdevelop 4.7
sudo apt-add-repository ppa:kubuntu-ppa/backports
sudo apt-get update

#you may be able to skip this step if you want, but I did it.
View gist:9338b776d360e6a319bd
make: Entering directory `/home/dverweire/projects/node/node-odbc/build'
CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
../src/odbc.cpp: In static member function ‘static void ODBC::Init(v8::Handle<v8::Object>)’:
../src/odbc.cpp:65:16: warning: unused variable ‘isolate’ [-Wunused-variable]
v8::Isolate* isolate = v8::Isolate::GetCurrent();
../node_modules/nan/nan_new.h: In instantiation of ‘typename NanIntern::Factory<T>::return_t NanNew(A0) [with T = v8::Integer; A0 = long int; typename NanIntern::Factory<T>::return_t = v8::Local<v8::Integer>]’:
../src/odbc.cpp:386:18: required from here
../node_modules/nan/nan_new.h:209:41: error: call of overloaded ‘New(long int&)’ is ambiguous
return NanIntern::Factory<T>::New(arg0);
^
View psql-linux-setup.md

/etc/ld.so.conf.d/psql.conf

#pervasive sql libraries
/usr/local/psql/lib/

Then issue sudo ldconfig

View readstuff.js
var prompt = require('prompt');
var result2 = [];
//not sure what this does so don't know when it should be called.
prompt.start();
function getData() {
prompt.get(['username', 'email'], function (err, result) {
if (err) { return onErr(err); }
console.log('Command-line input received:');
@wankdanker
wankdanker / binding.gyp
Created Oct 4, 2012
uv_queue_work question
View binding.gyp
{
'targets' : [
{
'target_name' : 'modulename',
'sources' : [
'modulename.cpp'
]
}
]
}
@wankdanker
wankdanker / odbc-bench.c
Created Apr 16, 2012
benchmark minimal query using raw odbc
View odbc-bench.c
/*
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
@wankdanker
wankdanker / gist:2400514
Created Apr 16, 2012
node-mysql-bindings-benchmarks + node-odbc
View gist:2400514
./bin/node-mysql-bindings-benchmark.js
Benchmarking CPP-MySQL:
**** Benchmark initialization time is 0.00s
**** 1000000 escapes in 0.17s (5882352/s)
**** 1000 sync reconnects in 0.09s (11111/s)
**** 10000 sync insertions in 0.16s (62500/s)
Benchmarking PHP-MySQL:
**** Benchmark initialization time is 0s
**** 1000000 escapes in 0.66s (1508394/s)
**** 1000 sync reconnects in 0.23s (4307/s)