Skip to content

Instantly share code, notes, and snippets.

@bespokoid
bespokoid / SpaceVim.md
Last active May 20, 2024 23:27
SpaceVim cheatsheet #tools
# Custom history configuration
# Run script using:
# chmod u+x better_history.sh
# sudo su
# ./better_history.sh
echo ">>> Starting"
echo ">>> Loading configuration into /etc/bash.bashrc"
echo "HISTTIMEFORMAT='%F %T '" >> /etc/bash.bashrc
echo 'HISTFILESIZE=-1' >> /etc/bash.bashrc
@giovtorres
giovtorres / virt-install-centos
Last active March 15, 2023 09:57
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
#!/usr/bin/env node
###########################################################################################
# Dynamic inventory for Ansible with DNS
# Author Remie Bolte (https://nl.linkedin.com/in/remiebolte)
#
# This NodeJS script generates a dynamic inventory based on DNS TXT records.
#
# If you use the “--inventory” switch when calling Ansible, you can provide the
# path to a directory which includes inventory files. Ansible will automtically
@kmassada
kmassada / README.md
Last active September 4, 2021 12:22
Vagrant and KVM(QEMU) on Centos7

Libvirt

yum group install -y "Development Tools"
yum -y install qemu-kvm libvirt virt-install bridge-utils libvirt-devel  libxslt-devel libxml2-devel libvirt-devel libguestfs-tools-c
echo "net.ipv4.ip_forward = 1"|sudo tee /etc/sysctl.d/99-ipforward.conf
sysctl -p /etc/sysctl.d/99-ipforward.conf
@rogerbush8
rogerbush8 / install-libreswan-xl2tpd-ipsec-vpn-remote-access-on-aws-ec2_aws_linux_ami_201409
Last active December 23, 2018 18:44
install-libreswan-xl2tpd-ipsec-vpn-remote-access-on-aws-ec2_aws_linux_ami_201409
#!/bin/sh
#
# Shell script for installation and setup of L2TP/IPsec VPN tunnel in remote access
# mode. Remote access mode allaows individual users to login using username/password
# and be allocated IP on the private network. Uses shared secret (PSK) and username/password
# in file (ppp chap-secret) for authentication. VPN software is libreswan + xl2tpd + pppd.
#
# This should work on linux systems that are RHEL based.
#
# To install directly from this gist, you can curl the "raw" version and pipe that to
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 23, 2024 18:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@bortzmeyer
bortzmeyer / gist:1284249
Created October 13, 2011 13:42
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys