Skip to content

Instantly share code, notes, and snippets.

View nathanejohnson's full-sized avatar

Nathan Johnson nathanejohnson

View GitHub Profile
scale=8
### Logic.BC - Do bitwise functions with GNU bc
# Perform a bitwise logical AND of x and y
define and(x,y) {
auto z, t, xx, yy, os;
os=scale;scale=0
z=0;t=1;for(;x||y;){
xx=x/2;yy=y/2
INFO global: Vagrant version: 2.2.2
INFO global: Ruby version: 2.4.4
INFO global: RubyGems version: 2.6.14.1
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.2/gems/vagrant-2.2.2/bin/vagrant"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_LOG="debug"
WARN global: resolv replacement has not been enabled!
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/2.2.2/gems/vagrant-2.2.2/plugins/synced_folders/nfs/plugin.rb
2016-09-29 16:48:55,365 - CRITICAL - FAILED: test_02_snapshot_data_disk: ['Traceback (most recent call last):\n', ' File "/usr/lib64/python2.7/unittest/case.py", line 369, in run\n testMethod()\n', ' File "/home/njohnson/cloudstack-ena/test/integration/component/test_snapshots.py", line 307, in test_02_snapshot_data_disk\n snapshot.id))\n', ' File "/usr/lib64/python2.7/unittest/case.py", line 462, in assertTrue\n raise self.failureException(msg)\n', 'AssertionError: False is not true\n']
2016-09-29 17:23:34,777 - CRITICAL - FAILED: test_01_snapshot_on_rootVolume: ['Traceback (most recent call last):\n', ' File "/usr/lib64/python2.7/unittest/case.py", line 369, in run\n testMethod()\n', ' File "/home/njohnson/cloudstack-ena/test/integration/component/test_snapshots_improvement.py", line 305, in test_01_snapshot_on_rootVolume\n self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, root_volume_snapshot.id))\n', ' File "/usr/lib64/python2.7/unittest/case
This file has been truncated, but you can view the full file.
@Desc: Test Attach ISO to VM and Detach ISO from VM. ... === TestName: test_13_attach_detach_iso | Status : EXCEPTION ===
ERROR
@Desc: Test VM Snapshots pagination. ... === TestName: test_14_vm_snapshot_pagination | Status : EXCEPTION ===
ERROR
@Desc: Test Revert VM to Snapshot functionality. ... === TestName: test_15_revert_vm_to_snapshot | Status : EXCEPTION ===
ERROR
@Desc: Test to verify pagination of Volumes for a VM ... === TestName: test_16_list_vm_volumes_pagination | Status : SUCCESS ===
ok
@Desc: Test to verify change service for Running VM ... === TestName: test_17_running_vm_scaleup | Status : SUCCESS ===
ok
@nathanejohnson
nathanejohnson / gdb.txt
Created February 27, 2016 20:11
segfault when running tests
Starting program: /home/njohnson/aports/community/libcouchbase/src/libcouchbase-2.5.6/build/bin/sock-tests
[New LWP 20243]
[New LWP 20244]
[New LWP 20245]
[LWP 20244 exited]
[LWP 20243 exited]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7dc7766 in pthread_join () from /lib/ld-musl-x86_64.so.1
#0 0x00007ffff7dc7766 in pthread_join () from /lib/ld-musl-x86_64.so.1
abuildx86:~/aports/community/go/src/go/bin$ strace ./go
execve("./go", ["./go"], [/* 17 vars */]) = 0
set_thread_area({entry_number:-1, base_addr:0xb773e844, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 (entry_number:6)
set_tid_address(0xb773e860) = 29534
mprotect(0xb773d000, 4096, PROT_READ) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault
abuildx86:~/aports/community/go/src/go/bin$
#include <stdio.h>
int i=0;
void a() {
printf("recursion depth: %d\n", ++i);
a();
}
int main(int argc, char **argv) {
a();
<?php
class Test {
private $foo = NULL;
private $bar = NULL;
public function __construct($foo, $bar) {
$this->foo = $foo;
$this->bar = $bar;
}
public function __sleep()
{
@nathanejohnson
nathanejohnson / libcouchbase_example.c
Last active December 16, 2015 09:29
Modified libcouchbase hello world example
#include <libcouchbase/couchbase.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAX_VALUE_SIZE 4096
static void error_callback(lcb_t instance,
lcb_error_t err,
const char *errinfo)
{