Skip to content

Instantly share code, notes, and snippets.

View labrt-install-full.sh
#!/bin/bash
set -x
set -e
# ==========
# INITIAL SETUP
# ==========
echo "127.0.0.1 labrt.local puppet" >> /etc/hosts
View foreman-uninstall.sh
# 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
View foreman-install.sh
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
@Vultour
Vultour / jekyll-trouble-links.sh
Last active Oct 1, 2016
Finds links that can cause trouble (relative links)
View jekyll-trouble-links.sh
View centos-kickstart-basic.ks
# 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
View xfce4-cmatrix.sh
#!/bin/bash
TERMCONF="~/.config/xfce4/terminal"
if [ ! -e $TERMCONF/terminalrc ]; then
mkdir -p $TERMCONF
echo "[Configuration]" > $TERMCONF/terminalrc
fi
@Vultour
Vultour / find.sh
Created Sep 27, 2016
Time-specific find
View find.sh
#!/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
@Vultour
Vultour / rust-client.rs
Created Aug 15, 2016
TCP client in Rust
View rust-client.rs
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){
@Vultour
Vultour / rust-server.rs
Created Aug 15, 2016
TCP server in Rust
View rust-server.rs
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();