Skip to content

Instantly share code, notes, and snippets.

View DBarthe's full-sized avatar

Delemotte Barthélémy DBarthe

View GitHub Profile
[Unit]
Description=Description for sample script goes here
After=network.target
[Service]
Type=simple
ExecStart=/root/start-bridges.sh
TimeoutStartSec=0
[Install]
package ressources;
import java.util.Collection;
import java.util.HashSet;;
import java.util.stream.Collectors;
public class LicenceManager {
private HashSet<Licence> licences = new HashSet<>();
@DBarthe
DBarthe / install-python36.sh
Last active July 7, 2017 07:56
Install python3.6 environnement on centos7
sudo yum -y update
sudo yum -y install yum-utils
sudo yum -y groupinstall development
sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
sudo yum -y install python36u
sudo yum -y install python36u-pip
sudo yum -y install python36u-devel
#!/usr/bin/env bash
remote=${1:-origin}
branch=${2:-master}
commit=$(git log -1 | head -n 1 | cut -d' ' -f 2)
git push ${remote} +${commit}^:${branch}
git reset HEAD^ --hard
@DBarthe
DBarthe / stress-cpus.sh
Created May 10, 2017 11:59
One line bash (many) cpus stress
fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; fulload; fulload; fulload; fulload; fulload; fulload; fulload ; fulload; fulload ; fulload; fulload ; read; killall dd
class Demonstration {
public void getIp(byte[] packet) {
// disons que l'ip commence à packet[0]
int w = packet[0] & 0xFF; // premier octet
int x = packet[1] & 0xFF; // deuxieme octet
int y = packet[2] & 0xFF; // troisieme...
int z = packet[3] & 0xFF; // quatrieme ...