This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/[email protected]/msg01707/lxc-fedora.in | |
if [ $# != 1 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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\";} |