Skip to content

Instantly share code, notes, and snippets.

Petr Michalec epcim

Block or report user

Report or block epcim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View virtualbox-build.howto.md.sh
#!/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 Aug 12, 2016
byobu with default windows
View byobu.sh
#!/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 Jun 3, 2014
Delete and Rebuild Keystone database
View gist:39045a714249ca7f771c
# 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
View contrail-heat
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 Nov 16, 2016
openstack tempest cleanup
View openstack_tempest_cleanup.sh
#!/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 Nov 18, 2016
contrail-all-in-one-in-vm
View contrail-all-in-one-in-vm.md
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 Sep 15, 2016
ifmap-server-error-handling
View 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
View gist:3f09e55183d9f287d6fe6f8076a4ccc3

Signing someone else key

Get key to sign

gpg --list-keys

Sign the key

gpg --sign-key --ask-cert-level 0xXXXXXXXXX
@ermus19
ermus19 / GPG.txt
Last active Apr 5, 2017
GPG & github gpg sign
View GPG.txt
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>
You can’t perform that action at this time.