Skip to content

Instantly share code, notes, and snippets.

View SamyCoenen's full-sized avatar

Samy Coenen SamyCoenen

View GitHub Profile
<script>
$(document).ready(function(){
$("input[type='submit']").click(function (event){
var fout=false;
naamControle();
function naamControle(){
if($("#naam").val().trim()===""){
private StreamWriter swSender;
private StreamReader srReceiver;
private TcpClient tcpServer;
private Thread thrMessaging;
private IPAddress ipAddr;
private bool Connected;
private void InitializeConnection()
{
// Parse the IP address
@SamyCoenen
SamyCoenen / Windows_Desktop_Boxstarter_Script
Last active January 13, 2017 13:05
Automatically install windows software by going to the following link http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/............. (raw file)
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst 7zip.install
cinst adobereader
cinst atom
cinst filebot
cinst filezilla
cinst firefox
cinst geforce-experience
@SamyCoenen
SamyCoenen / gist:60d01bbfa2f352aa4dd8e44b7fcf3560
Created January 13, 2017 13:03
Custom_Shell_Welcome_Random_Ubuntu_Tips_Cows
echo -e (echo "Welcome Samy Coenen!\n";and fortune -a)|cowsay -f (ls /usr/share/cowsay/cows/ | shuf -n1)
Add to your shell config:
- fish: ~/.config/fish/config.fish
@SamyCoenen
SamyCoenen / gist:0390171ec7e4daf1cc719fcdff53fc08
Created January 13, 2017 18:54
Youtube_Github_Readme.md
![Demo readme video](http://share.gifyoutube.com/....gif)](https://www.youtube.com/watch?v=......)
@SamyCoenen
SamyCoenen / gist:7aed270182596823375c985b6c3dcf85
Created January 18, 2017 09:55
Centos/7 Vagrant box authentication failure on Ubuntu
# open console for vm
chmod 0600 ~/.ssh/authorized_keys
@SamyCoenen
SamyCoenen / gist:c002d549a3053b2055afa9168fd735a4
Last active January 20, 2017 21:39
Connection with VM in a nested ESXI 6 from Workstation 12 Linux
sudo su
# make interface available to everyone
chmod a+rw /dev/vmnet2
# put interface in promiscuous mode
ifconfig vmnet2 promisc
@SamyCoenen
SamyCoenen / gist:33c9b61c7774b1caabf466b73be3cab6
Created January 26, 2017 09:18
Certificate expand with let's encypt and reverse proxy
#!/bin/bash
# maak een kopie van de huidige instellingen en certificaten
mv /home/student/backup/letsencrypt /home/student/backup/letsencrypt.old2
# zet de reverse_proxy_nginx uit, deze luisterd al reeds op poort 80, letsencrypt heeft deze poort nodig voor certificaten aan te vragen.
cd /home/student && docker-compose down
# Nu vragen we nieuwe certificaten aan. Deze komen op de locatie van /etc/letsencrypt
letsencrypt certonly --standalone -d vikingco.me -d www.vikingco.me -d kanban.vikingco.me -d jenkins.vikingco.me -d gitlab.vikingco.me -d api.vikingco.me -d test.vikingco.me -d testapi.vikingco.me -d php.vikingco.me -d testphp.vikingco.me
@SamyCoenen
SamyCoenen / gist:11067126071248c7e41756e6a9fb2931
Last active February 2, 2017 12:29
Linux disk read write benchmark
# show disks
lsblk
# Read Test
sudo hdparm -Tt /dev/sdb
# Write Test
dd if=/dev/zero of=/tmp/output conv=fdatasync bs=384k count=1k; rm -f /tmp/output
# Gui Benchmark
gnome-disks
# select disk and do benchmark
@SamyCoenen
SamyCoenen / backup_entire_elasticsearch.sh
Created March 26, 2018 21:40
Make a backup of all you indices on ElasticSearch with this Bash Script
#!/bin/bash
# Author: Samy Coenen
# Company: Gluo NV
SOURCE=https://............es.amazonaws.com
indice_list="$(curl -XGET $SOURCE/_cat/indices?pretty=true -v | cut -d $' ' -f3)"
for item in $indice_list
do
elasticdump \
--input=$SOURCE/$item \
--output=$ \