Skip to content

Instantly share code, notes, and snippets.

View anumercian's full-sized avatar

Anu Mercian anumercian

View GitHub Profile
@shalk
shalk / gist:7003628
Created October 16, 2013 06:51
virsh console with expect
#!/bin/bash
expect -c "
set timeout 10
spawn virsh console cvm1
expect {
\"Escape character\" {send \"\r\r\" ; exp_continue}
\"Escape character\" {send \"\r\r\" ; exp_continue}
\"login:\" {send \"root\r\"; exp_continue}
\"Password:\" {send \"111111\r\";}
@mycodeschool
mycodeschool / Stack_ArrayImplementation_OOP.cpp
Created October 8, 2013 02:44
An object oriented implementation of stack using arrays in C++.
// Stack - Object oriented implementation using arrays
#include <iostream>
using namespace std;
#define MAX_SIZE 101
class Stack
{
private:
int A[MAX_SIZE]; // array to store the stack
int top; // variable to mark the top index of stack.
@tonious
tonious / hash.c
Last active June 21, 2024 00:57
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
@peo3
peo3 / setup_lxc_rootfs_fedora15.sh
Created August 12, 2011 14:52
How to boot up Fedora 15 with systemd inside Libvirt LXC
#!/bin/sh
# Setup a rootfs of Fedora 15 for libvirt lxc
#
# The rootfs is based on http://download.openvz.org/template/precreated/fedora-15-x86_64.tar.gz
#
# See also
# - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01707/lxc-fedora.in
if [ $# != 1 ]; then