Skip to content

Instantly share code, notes, and snippets.

View skamithi's full-sized avatar

Stanley Karunditu skamithi

  • Raleigh, North Carolina
View GitHub Profile
@skamithi
skamithi / converting_from_virtualbox_to_kvm.md
Last active January 9, 2024 16:42
Windows7 Libvirt xml.

converted Virtualbox Win7 VM to KVM. (KVM on Ubuntu 14.04)

  • Shutdown Virtualbox VM.

  • Convert the vdi to a raw disk images. Note: vdi are compressed and raw images are not and so you will need to leave enough disk space for entire uncompressed disk.

VBoxManage clonehd --format RAW win7.vdi win7.img
  • Then on your KVM host:
@skamithi
skamithi / nslcd.conf
Created December 22, 2014 18:37
nslcd.conf confguration for Cumulus Linux KB on LDAP Authentication.
# /etc/nslcd.conf
# nslcd configuration file. See nslcd.conf(5)
# for details.
# The user and group nslcd should run as.
uid nslcd
gid nslcd
# The location at which the LDAP server(s) should be reachable.
uri ldaps://myadserver.rtp.example.test
@skamithi
skamithi / pep_501_check.md
Last active October 18, 2022 19:42
increasing size of max line to avoid pep8 e501 check

I use pymode to modify my python scripts. Keep on getting E501 when length of line is 82 or 83..which I think is just fine.

to fix this did the following

_$HOME/.config/pep8

[pep8]
max-line-length = 90
@skamithi
skamithi / create-ansible-playbook-template.sh
Created April 23, 2014 01:59
script to create ansible playbook structure
#!/bin/bash
# Script to create ansible playbook directories
# define your roles here
roles=(upgrade packages)
directories=(tasks handlers files default vars templates)
# create playbook
mkdir global_vars
@skamithi
skamithi / ssh_port_checker.sh
Last active June 23, 2019 16:09
Bash script to detect if SSH port is active on remote host. Used it orchestrating vm creation using ansible.
#!/bin/bash
# Script for checking if SSH port is open
# Only checks that port is open. Not that actually SSH connection can occur
counter=0
result="ssh disabled"
if [ -z "$1" ]
then
echo "hostname argument required. Example ssh_port_checker.sh 10.1.1.1"
@skamithi
skamithi / rails.sh
Created April 23, 2012 00:24
Sample Rails init startup script on ubuntu
### /etc/default/rails ###
APP_USER=vagrant
RVM_SETTING="1.9.3-p125@rails32"
RAILSDIR=/home/vagrant/rails
# Example: STAGES=("vagrant_staging", "vagrant_production")
STAGES=("vagrant_staging")
# Example APPS=("myapp1" "myapp2")
APPS=("myapp")
@skamithi
skamithi / create_vm_on_ubuntu_14_04.txt
Created September 6, 2014 19:22
creating vms using virt-builder and virt-install on ubuntu 14.04
! add current user to kvm group
usermod -a -G kvm skamithi
! create root password file
cat 'mypass' > /tmp/rootpw
! update soon with run-command to run 'dpkg-reconfigure openssh-server' to regenerate ssh keys
! without this you get a ssh reset peer message
virt-builder ubuntu-14.04 --root-password file:/tmp/rootpw -o ubuntu1404.qcow2 --format qcow2 --size 10G --hostname ubuntu1404
@skamithi
skamithi / key_fun
Last active October 16, 2018 04:46
funguo yangu
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxf7IGX+reoBVrvi8LWl8bbbXS6sbw/I1mwzJ4ixCEgGqRtC8EENkCBZaQWcuJ92GoIvG6Obtj1PhcsFekTFOZnChUrxvM9BTNWZbPukbCZTlVWib4U85WsDoNwsWdr+PH13yUgEyDr7iKgxY0i4fi8ooNM5YT7Zj3wENGThbpIah8PFWaWfK1IYmGFo/5FECEgykcoVfO3gJlBo59ObvlRb+V2M759Rk0Mq5aYhe3JMnCGtEKbsbnRMQvbvAjJexjC0rf4vfH6euEsSdEnyXLwvNQz8cD5aPzRj9M2sQiJm7AZyxaed0gPYITZiLYF3UCqo44yKlKYQll0+F0EbCf
https://codepen.io/skamithi/pen/eLjGGd?editors=1100
@skamithi
skamithi / working.log
Created May 20, 2018 13:10
RabbitMQ recovery
Last login: Sun May 20 02:09:59 2018 from 192.168.121.1
[vagrant@tower3 ~]$ sudo tail -f /var/log/rabbitmq/rabbitmq\@tower3
tail: cannot open ‘/var/log/rabbitmq/rabbitmq@tower3’ for reading: No such file or directory
tail: no files remaining
[vagrant@tower3 ~]$ sudo tail -f /var/log/rabbitmq/rabbitmq\@tower3.log
Mirrored queue '2e1669a9-2e90-3577-a332-644a2c24352d.reply.celery.pidbox' in vhost 'tower': Synchronising: all slaves already synced
=INFO REPORT==== 20-May-2018::13:05:07 ===
Mirrored queue '2e1669a9-2e90-3577-a332-644a2c24352d.reply.celery.pidbox' in vhost 'tower': Synchronising: 0 messages to synchronise