Skip to content

Instantly share code, notes, and snippets.

View bugyt's full-sized avatar

Laurent H. bugyt

View GitHub Profile
@bugyt
bugyt / emailReboot.sh
Last active January 26, 2016 08:37
Script to send mail
#!/bin/bash
sleep 60
IP=`hostname -i`
HOSTNAME=`hostname -f`
echo "@reboot $HOSTNAME online. IP address: $IP" > /root/email.txt
echo >> /root/email.txt
date >> /root/email.txt
@bugyt
bugyt / install.md
Last active January 28, 2016 18:30
ArchLinux Installation on KVM

(Based on Beginners' guide)

ArchLinux installation on KVM Virtual Machine

Host :

  • Debian Jessie

Guest :

  • ArchLinux 2016.01.01
  • Kernel 4.3.3
@bugyt
bugyt / ArchCheatSheet.md
Last active June 8, 2024 12:40
ArchLinux Cheat Sheet

ArchLinux Cheat Sheet

Network configuration

  • List network devices
      # ip link
    
  • Enabling and disabling network interfaces
      # ip link set <network interface> up
    

ip link set down

@bugyt
bugyt / DebianCheatSheet.md
Last active November 18, 2021 22:13
Debian Cheat Sheet

Debian Cheat Sheet

Bash

  • Clear bash history
      history -c
      history -w
    
pacman -Syu

pacman -S virtualbox-guest-utils

Fichier: /etc/modules-load.d/virtualbox.conf

vboxguest
vboxsf
vboxvideo
@bugyt
bugyt / nodejs.md
Last active January 27, 2016 19:30

Installing Node.js

Arch Linux

Node.js and npm packages are available in the Community Repository.

pacman -S nodejs npm

Debian

curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -

sudo apt-get install -y nodejs

@bugyt
bugyt / fwstop.sh
Created January 28, 2016 09:38
IPTABLES : Flush All Rules, Delete All Chains, and Accept All
#!/bin/bash
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
echo "Flush All Rules, Delete All Chains, and Accept All [OK]"
@bugyt
bugyt / myapp.wsgi
Last active February 8, 2016 15:08
Hello world WSGI Python application
#-*- coding: utf-8 -*-
def application(environ, start_response):
import sys
pvar = 'Hello world !!'
output = pvar.encode('utf8')
# output = sys.version.encode('utf8')
status = '200 OK'
headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, headers)
@bugyt
bugyt / Vagrantfile
Created February 11, 2016 14:21
Vagrantfile for Microsoft/EdgeOnWindows10
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@bugyt
bugyt / prepare_el_capitan_iso.sh
Last active October 24, 2017 11:07
Installing El Capitan in VirtualBox
#!/bin/bash
# Mount the installer image to some directory by using the hdiutil tool
hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/esd
# Now let's create a placeholder image of our ISO file
hdiutil create -o ElCapitan3.cdr -size 7316m -layout SPUD -fs HFS+J
# After an empty ISO file will be created, we need to mount it
hdiutil attach ElCapitan3.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/iso