Skip to content

Instantly share code, notes, and snippets.

@pellaeon
pellaeon / neutron client debug
Created September 27, 2015 14:40
neutronclient.client doesn't seem to recognize Keystone API v3
2015-09-27 22:34:36,421 neutronclient.client DEBUG
REQ: curl -i http://172.29.236.19:5000/v3/tokens -X POST -H "User-Agent: python-neutronclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "REDACTED"}}}'
2015-09-27 22:34:36,456 neutronclient.client DEBUG RESP:404 {'content-length': '93', 'vary': 'X-Auth-Token', 'server': 'Apache', 'date': 'Sun, 27 Sep 2015 14:34:36 GMT', 'content-type': 'application/json', 'x-openstack-request-id': 'req-073bd239-db55-4da9-8db2-7daf9f01ea36'} {"error": {"message": "The resource could not be found.", "code": 404, "title": "Not Found"}}
@pellaeon
pellaeon / kk.c
Created September 25, 2012 13:23
Example 2-23
/*
* =====================================================================================
*
* Filename: kk.c
*
* Description: KK
*
* Version: 1.0
* Created: 2012年09月25日 18時52分43秒
* Revision: none
無法完成安裝:「internal error process exited while connecting to monitor: char device redirected to /dev/pts/4
kvm: -drive file=/var/lib/libvirt/images/pellaeons_freebsd.img,if=none,id=drive-ide0-0-0,format=raw: could not open disk image /var/lib/libvirt/images/pellaeons_freebsd.img: Permission denied
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/asyncjob.py", line 45, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File "/usr/share/virt-manager/virtManager/create.py", line 1909, in do_install
guest.start_install(False, meter=meter)
File "/usr/lib/python2.7/dist-packages/virtinst/Guest.py", line 1236, in start_install
@pellaeon
pellaeon / a.bash
Created October 30, 2015 11:35
ip netns VPN
#!/bin/bash
#create bridge 'br0'
brctl addbr br0
#create network namespace 'ns0'
ip netns add ns0
#create virtual nic pair for hooking ns0
ip link add veth0 type veth peer name veth1
#adding veth1 into namespace 'ns0'
ip link set veth1 netns ns0
#bring ethernet NIC down for adding it to br0 later
import socket
import telnetlib
payload = bytearray()
for i in range(0,0x28):
payload.append(0x41)
for i in range(0, 4):
payload.append(0x42)
payload.append(0xCD)
payload.append(0x88)
/*
* =====================================================================================
*
* Filename: concatenate_lists.c
*
* Description: Concatenates 2 linked lists of characters
*
* Version: 1.0
* Created: 2013年01月07日 11時38分00秒
* Revision: none
obj-m +=feng.o
KERNELDIR ?= ~/android/kernel/k2u-jb-3.4.10-cl157896-1-built
PWD := $(shell pwd)
CROSS_COMPILE=/home/pellaeon/toolchains/arm-eabi-4.6/bin/arm-eabi-
ARCH=arm
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
namespace OC\Core\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Auth extends Command {
protected function configure() {
PhantomJS 2.1.1 (Linux 0.0.0) OCA.Files.FileList tests loading file list scroll distance is read from sessionStorage FAILED
TypeError: null is not an object (evaluating 'getItemStub.getCall(0).args') in /var/www/html/owncloud/apps/files/tests/js/filelistSpec.js (line 1391)
/var/www/html/owncloud/apps/files/tests/js/filelistSpec.js:1391:33
@pellaeon
pellaeon / cloudconfig.txt
Created August 7, 2016 07:16
pellaeon's cloudconfig
#cloud-config
apt_mirror: http://ubuntu.cs.nctu.edu.tw/ubuntu/
timezone: Asia/Taipei
package_upgrade: true
packages:
- mosh
- git
- screen
- htop