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
use std::io::prelude::*; | |
use std::net::{TcpListener, TcpStream, Shutdown}; | |
use std::sync::mpsc; | |
use std::io::BufReader; | |
use std::thread; | |
use std::str; | |
fn listen(tx_pipe: mpsc::Sender<u32>){ | |
let listener = TcpListener::bind("127.0.0.1:7777").unwrap(); |
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
extern crate rand; | |
use std::io::prelude::*; | |
use std::thread; | |
use std::time::Duration; | |
use std::net::{TcpStream, Shutdown}; | |
use rand::Rng; | |
fn thread_exec(id: u32){ |
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 | |
USAGE="Usage: $0 <FOLDER> <ORIGIN-FILE> <TIME-LIMIT> [RECURSIVE?]" | |
if [ -z $1 ] || [ -z $2 ] || [ -z $3 ]; then | |
echo $USAGE | |
exit 1 | |
fi | |
DIR=$1 |
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 | |
TERMCONF="~/.config/xfce4/terminal" | |
if [ ! -e $TERMCONF/terminalrc ]; then | |
mkdir -p $TERMCONF | |
echo "[Configuration]" > $TERMCONF/terminalrc | |
fi |
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
# Install with: | |
# virt-install --graphics vnc --name test-1 --memory 2048 --disk machines/test-1.img,size=5 --location http://mirrors.clouvider.net/CentOS/7/os/x86_64/ -x "ks=THIS-KICKSTART_URL" | |
install | |
cdrom | |
lang en_US.UTF-8 | |
keyboard us-acentos | |
network --device eth0 --bootproto dhcp | |
# password = password | |
rootpw --iscrypted $1$nRuazCWk$gUSUI.shpjrhm2fWgrEwY0 | |
firewall --disabled |
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
# Finds links that can cause trouble (relative links) | |
# flags '#' links, you might want to filter those | |
grep -rnoE 'src=".*?"' _OUTPUT/ | grep '.html' | grep -vE 'http|mailto:' | sort | uniq -f 1 | awk -F : '{print $3, "---", $2, " : ", $1}' | |
grep -rnoE 'href=".*?"' _OUTPUT/ | grep '.html' | grep -vE 'http|mailto:' | sort | uniq -f 1 | awk -F : '{print $3, "---", $2, " : ", $1}' |
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
rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm | |
yum -y install epel-release https://yum.theforeman.org/releases/1.12/el7/x86_64/foreman-release.rpm | |
yum -y install foreman-installer | |
foreman-installer -v |
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
# Remove foreman | |
yum remove remove foreman foreman-installer foreman-proxy | |
rm -rf /var/lib/foreman /usr/share/foreman /usr/share/foreman-proxy/logs | |
rm /etc/httpd/conf.d/foreman.conf | |
# Remove puppet | |
yum remove puppet puppetmaster puppet-common puppetmaster-common puppetlabs-release | |
rm -rf /usr/lib/ruby/vendor_ruby/puppet /usr/share/puppet /var/lib/puppet /etc/puppet | |
rm /etc/apache2/conf.d/puppet.conf |
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 | |
set -x | |
set -e | |
# ========== | |
# INITIAL SETUP | |
# ========== | |
echo "127.0.0.1 labrt.local puppet" >> /etc/hosts |