Skip to content

Instantly share code, notes, and snippets.

View goffinet's full-sized avatar

goffinet

View GitHub Profile
@goffinet
goffinet / regenerate_ssh_host_keys
Created February 2, 2017 18:37
Regeneration ssh host keys
#!/bin/bash
rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
systemctl restart sshd
@goffinet
goffinet / kernel.deb.sh
Last active February 5, 2017 23:17
deban jessie kernel update to 4.9.8
#!/bin/bash
sudo apt update && apt update -yqq && apt dist-upgrade -yqq
sudo apt install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc -yqq
sudo apt install kernel-package -yqq
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.8.tar.xz
unxz linux-4.9.8.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.8.tar.sign
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 38DBBDC86092693E
gpg2 --verify linux-4.9.8.tar.sign
tar xvf linux-4.9.8.tar
@goffinet
goffinet / arch_kvm_install.md
Last active February 12, 2017 16:19 — forked from tlatsas/arch_kvm_install.md
archlinux kvm guest install cheatsheet
  • partitions
    • use the tool of your choice (fdiks/gdisks/parted)
    • gdisk p1 +1M EF02 (bios boot)
  • filesystems
    • mkfs -t <fs-type> /dev/<partition>
  • mount partitions on /mnt
  • setup network
    • ip address add <IP>/<CIDR> dev eth0
    • ip route add default via <GW>
    • add dns in /etc/resolve.conf
#!/bin/bash
# openvpn-install.sh original from https://github.com/Nyr/openvpn-install
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS
# This script will work on Debian, Ubuntu, CentOS and probably other distros
# of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want to setup a VPN on
# your Debian/Ubuntu/CentOS box. It has been designed to be as unobtrusive and
# universal as possible.
@goffinet
goffinet / create_vhost_httpd.sh
Last active April 1, 2019 17:56
create_vhost_httpd.sh in Centos7
#!/bin/bash
#create_vhost_httpd.sh in Centos7
#Variables
host=$1
port="80"
location="/var/www/html"
error_log="/var/log/httpd/${host}-error_log"
access_log="/var/log/httpd/${host}-access_log common"
#Résolution de nom locale
echo "127.0.0.1 ${host}" >> /etc/hosts
@goffinet
goffinet / create_vhost_httpds.sh
Created February 19, 2017 18:33
create_vhost_httpds.sh (HTTPS) in Centos7
#!/bin/bash
#create_vhost_httpds.sh in Centos7
#Variables
host=$1
port="443"
location="/var/www/html"
error_log="/var/log/httpd/${host}-error_log"
access_log="/var/log/httpd/${host}-access_log common"
#Résolution de nom locale
echo "127.0.0.1 ${host}" >> /etc/hosts
@goffinet
goffinet / net.sh
Last active August 13, 2020 07:20
Centos7 router config iptables/ip6tables/ifcg-files
#!/bin/bash
ip4="192.168.168"
ip6="fd00:168:168"
lan="eth0"
wan="eth1"
1_interfaces () {
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="no"
@goffinet
goffinet / rPi3-ap-setup.sh
Last active April 5, 2017 19:15 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2016 rpi jessie image, please use this image
#
network="10.0.0"
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@goffinet
goffinet / install_https_ghost_blog.sh
Last active July 22, 2017 09:21
install https ghost blog in ubuntu 16.04 xenial with nginx proxy, letsencrypt and cloudflare api
#!/bin/bash
## 1. Set variables
SITE="blog1"
ZONE="example.com"
MAIL="root@example.com"
CF_TOKEN="your_api"
## Do not touch any others
CF_EMAIL=$MAIL
CF_ZONE=$ZONE
@goffinet
goffinet / uscw.rc
Created May 9, 2017 21:08
ubuntu on scw virt-scripts adaptation
#!/bin/bash
download_install_virt-scripts () {
cd
apt-get -y install git
git clone https://github.com/goffinet/virt-scripts
cd virt-scripts
./autoprep.sh
}