Skip to content

Instantly share code, notes, and snippets.

View HugoPoi's full-sized avatar

Hugo Poissonnet HugoPoi

View GitHub Profile
@HugoPoi
HugoPoi / Game.ini
Created January 14, 2017 14:50
Backup Config Ark Server Modded
[/script/shootergame.shootergamemode]
GlobalSpoilingTimeMultiplier=5
GlobalItemDecompositionTimeMultiplier=3
GlobalCorpseDecompositionTimeMultiplier=3
MatingIntervalMultiplier=0.1
EggHatchSpeedMultiplier=16.0
BabyMatureSpeedMultiplier=16.0
BabyCuddleIntervalMultiplier=0.1
bPassiveDefensesDamageRiderlessDinos=true
PerLevelStatsMultiplier_DinoTamed_Add[0]=0.50
@HugoPoi
HugoPoi / wifi-power-sample.js
Created January 26, 2017 13:44
Use iwconfig and extract signal and link quality to csv (nodejs)
var exec = require('child_process').exec;
var argv = require('minimist')(process.argv.slice(2));
var stringify = require('csv-stringify');
var fs = require('fs');
function takeMesure(callback){
exec('iwconfig wlan0', function(err, stdout, stderr){
//console.log(stdout);
var essid = /ESSID:"(.+)"/.exec(stdout),
power = /Bit Rate=([0-9]+) +Mb\/s +Tx\-Power=([0-9]+) dBm/.exec(stdout),
@HugoPoi
HugoPoi / madplay.conf
Last active January 28, 2017 16:36
iot failed to secure things, today i choose to pilote my thing with a file injected in a shell script running as root
http://192.168.1.97:8081/|-20
@HugoPoi
HugoPoi / dbxcligetfiles.sh
Created July 5, 2017 12:44
Download only certain file with dbxcli
#!/bin/bash
#
# Usage : dbxcligetfiles.sh "\*\.png" /Webdesign
#
dbxcli search $1 $2 | while read line
do
echo $line
mkdir -p ".${line%/*}"
dbxcli get "$line" ".$line"
done
@HugoPoi
HugoPoi / robomongo.desktop
Created November 10, 2017 14:45
Shorcut robomongo cinnamon ~/.local/share/applications/
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Name=Robomongo
Comment=Launch Robomongo
Icon=/opt/robomongo/robomongo.png
Exec=/usr/sbin/robomongo
Terminal=false
Type=Application
Categories=Developer;
@HugoPoi
HugoPoi / iptables_reset.sh
Created March 15, 2018 16:16
Iptables reset policies
#!/bin/sh
IPTABLES="$(which iptables)"
# RESET DEFAULT POLICIES
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT
@HugoPoi
HugoPoi / concurrent-request-agent.test.js
Created June 4, 2018 10:55
Test concurrent calls with an agentClass ( mocha runner )
/*jshint node: true*/
"use strict";
process.env.NODE_ENV = 'test';
const assert = require('assert');
const Request = require('request-promise');
const HttpsAgent = require('socks5-https-client/lib/Agent');
const Promise = require('bluebird');
@HugoPoi
HugoPoi / sample.test.js
Created June 18, 2018 16:55
Loopback sample mocha unit test
'use strict';
const loopback = require('loopback');
const expect = require('chai').expect;
const request = require('supertest');
describe('Test relations update support', function() {
// Create a new loopback app.
@HugoPoi
HugoPoi / generateWhoisConf.js
Last active September 8, 2018 14:43
Generate /etc/whois.conf file for gnu whois command
/*
* Usage : node generateWhoisConf.js > /etc/whois.conf
*/
var json = require('comment-json');
var request = require('request');
request('https://github.com/weppos/whois/raw/master/data/tld.json', function(error, response, body){
var obj = json.parse(body);
Object.keys(obj).forEach(function(key){
@HugoPoi
HugoPoi / get_collections_sizes.js
Created January 30, 2019 16:21
MongoDB Get collections storage sizes in GB sorted
(() => {
let datas = [];
db.getCollectionNames().forEach(colName => {
let stats = db.getCollection(colName).stats();
datas.push({
colName,
size : stats.storageSize,
humanSize: (stats.storageSize / (1024*1024*1024)) + ' GB'
});