Skip to content

Instantly share code, notes, and snippets.

View sharkoz's full-sized avatar
😃

Cosme Charlier sharkoz

😃
  • Cdiscount
  • Bordeaux, France
View GitHub Profile
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
@sharkoz
sharkoz / gist:a669c1487ae05222f98e
Created January 22, 2015 15:45
Duplicate log and add timestamps
tailf -n0 bar.raw.log | while read line; do echo "$(date -R) $line" >> bar.log; done;
from : http://unix.stackexchange.com/questions/56189/appending-timestamp-stamp-along-with-log-file-lines
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@sharkoz
sharkoz / Notepad edit.ahk
Last active August 29, 2015 13:57
Auto Hotkey AHK Edit file in notepad++ when Left+Right clicking a file. #AHK
~LButton & RButton::
Send {LButton Up}
FilePath:=""
FilePath:=GetFile()
IfExist, %FilePath%
Run "C:\...\Notepad++ 6.2\notepad++.exe" %FilePath%
return
GetFile() {
ClipSave:=ClipboardAll
@sharkoz
sharkoz / .vimrc
Created March 6, 2014 15:45
Allow vim to open *ZIP files as zip files.
augroup ZIP
au BufReadPre *ZIP setlocal bin
au BufReadCmd *ZIP call zip#Browse(expand("<amatch>"))
au BufWriteCmd *ZIP call zip#Write(expand("<amatch>"))
au FileReadCmd *ZIP zip#Read(expand("<amatch>"), 0)
au FileReadPre *ZIP setlocal bin
au FileWriteCmd *ZIP call zip#Write(expand("<amatch>"))
augroup END
@sharkoz
sharkoz / gist:9210529
Last active August 29, 2015 13:56
Recuperer restits du jour
sudo su - hraadmin -c '/exploit/hra/script/appli/STD/lien/;cp /data/sas-echange/archidep/work/hr2dep2dctmdep/GLU/in/*'$(date "+%Y-%m-%d")'*.xls /tmp/'
sudo su - hraadmin -c '/exploit/hra/script/appli/STD/lien/;chmod 777 /tmp/*'$(date "+%Y-%m-%d")'*'
@sharkoz
sharkoz / import.sql
Last active December 30, 2015 22:29 — forked from mheadd/dartfirststate_de_us.sql
Import données GTFS (des transiliens SNCF) en base de données MySQL
-- -------------------------------------------------------------------------------------------------------
-- A SQL script for importing GFTS data from the State of Delaware into a MySQL database.
--
-- Copyright 2010 Mark J. Headd
-- http://www.voiceingov.org
--
-- This file is free software; you can redistribute it and/or modify it under the terms of the
-- GNU Library General Public License as published by the Free Software Foundation; either version 2 of the
-- License, or (at your option) any later version.
-- This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
@sharkoz
sharkoz / execbql
Last active December 26, 2015 07:29
Execution de commandes SQL par chaîne HR Access BQL
1) Créer un fichier /produit/hra/file/PSBBCLLI.CXX (XX IDJOB, tu renseignes ce que tu veux)
2) Dans le fichier écrire pour chaque commande SQL :
<PGMBCL>
DELETE FROM ZY00 WHERE NUDOSS = +000001299
<PGMBCL>
Si besoin, faire un retour auto a la ligne avec "fold" :
fold foo > PSBBCLLI.CXX
@sharkoz
sharkoz / Merge csv files
Last active December 16, 2015 11:28
[Excel] Merge csv or xls files in a single xls file
Sub recup()
Range("A1").Select 'sélectionner la cellule de début
Chemin = "C:\Documents and Settings\ccharlier-adc\Mes documents\Téléchargements\" 'saisir le chemin complet du dossier où se trouvent les fichiers
Fichier = Dir(Chemin & "EC_*.csv") ' Premier fichier
Do While Fichier <> ""
'Pour des xls
'Workbooks.Open Filename:=Chemin & Fichier
'Pour des csv
@sharkoz
sharkoz / Scp
Created April 20, 2013 19:14
[Shell] Secure copy to another server using own logname
put(){ txt=$(logname); scp "$1" ${txt}@serveradress:/home/path/; };