Skip to content

Instantly share code, notes, and snippets.

View scips's full-sized avatar

Sébastien Barbieri scips

View GitHub Profile
@scips
scips / rename_files.sh
Created October 10, 2017 19:00
rename files bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for i in `ls | grep 360p`; do
NEWNAME=`echo $i | sed 's/ \[360p\]//'`;
echo $i " -> " $NEWNAME;
mv "$i" "$NEWNAME";
done
IFS=$SAVEIFS
@scips
scips / infiniteloop.sh
Created October 9, 2017 14:20
Make an infinite loop while true and set the xterm title the command executed
#!/bin/bash
TITLE="$@"
printf '\e]2;%s\a' "$TITLE";
while true
do
"$@"
sleep 30
done
#!/bin/bash
# count node
for i in `ls *brol*.xml`; do
xmllint --xpath 'count(//segmentation/segment)' ${i} >> temp.text;
echo " ${i}" >> temp.text;
done;
# concat multiple field matching some text
for i in `ls *LATROIS*xml`; do
xmllint --xpath 'concat(//maxEpisode[text()='0']/../titre/text(), "-", //maxEpisode[text()='0']/../genre/text())' ${i};
echo "";
@scips
scips / .bashrc
Created September 18, 2017 13:44
bashrc
export VISUAL=vim
export EDITOR="$VISUAL"
@scips
scips / ssh_tunnel.md
Created August 31, 2017 08:38
SSH Tunnel + Socks Proxy

SSH Tunnel

ssh -D 8123 -f -C -q -N <remoteuser@remotehost>

Proxy

Configure your Proxy Socks in the network settings of:

  • your browser
  • your DB Client

Keybase proof

I hereby claim:

  • I am scips on github.
  • I am scips (https://keybase.io/scips) on keybase.
  • I have a public key whose fingerprint is A627 C171 7037 41CE 3BD1 7FEF 2CCB 56FB 94A4 FC3F

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
#board {
border: 1px solid black;
}
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Small game to guess additions">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.show {display: block}
.hide {display: none}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>WebVR tyout</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/aframe/0.3.1/aframe.min.js"></script>
</head>
<body>
<a-scene stats>
var googleItems = [];
if(_gaq_account) {
googleItems.push('Google Analytics: '+_gaq_account);
}
if(typeof ga === 'function') {
ga(function(){
var trackers = ga.getAll();
for (var i=0; i < trackers.length; ++i) {
var tracker = trackers[i];
googleItems.push("Analytics Universal: "+tracker.get('trackingId'));