Skip to content

Instantly share code, notes, and snippets.

View epcim's full-sized avatar

Petr Michalec epcim

View GitHub Profile
#!/bin/zsh
#
## build kernel modules, if fail
cd /var/lib/dkms/vboxhost/`vboxmanage --version | sed 's/^\(......\).*/\1/'|tail -n 1`/build; sudo make KERNELRELEASE=`uname -r` -C /lib/modules/`uname -r`/build M=/var/lib/dkms/vboxhost/`vboxmanage --version | sed 's/^\(......\).*/\1/'|tail -n1`/build; for i in `find vbox* -name "*.ko"`;do sudo mkdir -p /lib/modules/`uname -r`/misc; sudo cp -v $i /lib/modules/`uname -r`/misc;sudo insmod /lib/modules/`uname -r`/misc/`basename $i`;done
K=`uname -r`
sudo rmmod vboxnetadp vboxnetflt vboxpci vboxdrv vmmon vmnet
for i in `ls /lib/modules/$K/misc/|xargs`; do
sudo insmod /lib/modules/$K/misc/$i;
done
@epcim
epcim / byobu.sh
Last active August 12, 2016 10:33
byobu with default windows
#!/bin/bash
test -n SSH_AGENT || {
eval $(ssh-agent -s)
ssh-add
}
#create session
byobu-tmux new-session -dn $(hostname -f) "sudo -i"
# populate from salt-key
@discoposse
discoposse / gist:39045a714249ca7f771c
Created June 3, 2014 22:58
Delete and Rebuild Keystone database
# Log in to MySQL command line as root
drop database keystone;
create database keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'KEYSTONE_DBPASS';
exit
# now from the shell
sudo su -c "keystone-manage db_sync" keystone
With Release 3.0, contrail-heat resources/templates are being auto-generated from the Schema.
The generated resources/templates are part of the python-contrail package and located in
/usr/lib/python2.7/dist-packages/vnc_api/gen/heat/ directory. This directory has three sub-directories
1. resources/
This sub-directory contains all the resources for the contrail-heat plugin. It runs in the context
of the heat-engine service.
2. templates/
This sub-directory contains template for each resource. They are sample templates with every possible
@epcim
epcim / openstack_tempest_cleanup.sh
Created November 16, 2016 10:35
openstack tempest cleanup
#!/bin/bash
# cleanup tempest
neutron port-list --all-tenants | grep tempest | awk '{print $2}' | xargs -i neutron port-delete {}
neutron subnet-list --all-tenants | grep tempest | awk '{print $2}' | xargs -i neutron subnet-delete {}
neutron subnet-list --all-tenants | grep "100.FIXME" | awk '{print $2}' | xargs -i neutron subnet-delete {}
neutron net-list --all-tenants | grep tempest | awk '{print $2}' | xargs -i neutron net-delete {}
neutron net-list --all-tenants | grep snat-si-left_snat_ | awk '{print $2}' | xargs -i neutron net-delete {}
neutron security-group-list --all-tenants | grep tempest | awk '{print $2}' | xargs -i neutron security-group-delete {}
neutron router-list --all-tenants | grep tempest | awk '{print $2}' | xargs -i neutron router-delete {}
@ajayhn
ajayhn / contrail-all-in-one-in-vm.md
Last active November 18, 2016 10:01
contrail-all-in-one-in-vm
Following steps are needed in a VM environment for contrail all-in-one (assuming trusty r201)
sudo apt-get –y install curl
prep right hostname without this fab get_all_time fails
echo "127.0.0.1 $(hostname)" >>  /etc/hosts
prep keys WARNING do not do this if there is already id_rsa key.
@ajayhn
ajayhn / ifmap-server-error-handling
Created September 15, 2016 18:14
ifmap-server-error-handling
1. timeout when publishing to ifmap-server (mapclient.call())
when timeout happens keep retrying
2. ifmap-server code needs to inspect healthcheck object publish and if it misses n of them, exit() OR
config-nodemgr keeps reading healthcheck object from ifmap-server and if it can't read in n secs or value is stale, kill ifmap-server
3. control-node keeps reading healthcheck object from ifmap and it sees stale, move to a new ifmap-server
4. ifmap-publish-greenlet enqueue finds q-full, no change from current

Signing someone else key

Get key to sign

gpg --list-keys

Sign the key

gpg --sign-key --ask-cert-level 0xXXXXXXXXX
@ruben-rodriguez
ruben-rodriguez / GPG.txt
Last active April 5, 2017 06:57
GPG & github gpg sign
gpg --import private_key.asc
gpg --list-secret-keys --keyid-format LONG
gpg --delete-secret-key <key>
gpg --edit-key <key>
passwd
git config --global user.signingkey <key>