This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir -p /tmp/toto ; | |
| tmpfile=$(mktemp /tmp/toto/data-XXXXXX.json); | |
| ts=$(date -u -d"2017/04/01 00:00:00" "+%s"); | |
| curl -X GET --header 'Accept: application/json' "https://host/path?ts=$ts000" | sed 's/"/\\"/g' | sed -r 's/(\.[0-9]{12})([0-9]*)/\1/g' | sed -r 's/(([^0-9][0-9]{0,12})*):([0-9]{10})([0-9]{3}),((:?[0-9]{0,12}[^0-9:])*)/printf "%s%s%s" "\1" ":\\\"\3\4 $(date +%FT%TZ -u -d @\3)\\\"," "\5";/ge' > $tmpfile; | |
| # first sed escapes double quotes, because they will be printed by "print" | |
| # second sed truncate all numbers to 12 digits after point, in order to detect timestamps easier (timestamps here are milliseconds) | |
| # third sed appends to all timestamps, their equivalent dates | |
| firefox $tmpfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cd ~ | |
| git clone https://github.com/magicmonty/bash-git-prompt.git .bash-git-prompt --depth=1 | |
| cat >> ~/.gitconfig << EOF | |
| [user] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jq 'def thousandthToDate: . / 1000 | todate; walk(if type == "object" and has("dateControle") then .dateControle |= tostring + " " + thousandthToDate else . end)' controle.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Created by fab on 16/09/17. | |
| */ | |
| public abstract class AbstractBox { | |
| abstract void turn(boolean b, int i, int i1, int i2, int i3); | |
| abstract void toggle(int left, int bottom, int right, int top); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # place it under ~/.local/share/nautilus/scripts/ | |
| # and make it executable chmod u+x nautilus_backup.bash | |
| for f in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | |
| do | |
| cp -a $f $f~$(date --utc '+%Y-%m-%d_%H_%M_%S') | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| find <log_dir> -not -empty | xargs ls -t | head -n 1 | tailf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| find <log_dir> -not -empty | xargs ls -t | head -n $1 | tail -n 1 | xargs less -NX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cp --archive $1 $1~$(date --utc '+%Y-%m-%d_%H_%M_%S') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import re | |
| import io | |
| import unicodedata | |
| f = open('/home/fab/Documents/dp/election/bulletins.ps', | |
| encoding="latin-1") | |
| output = open('/home/fab/Documents/dp/election/bulletins_anonym_1.ps', 'w', | |
| encoding='latin-1') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %!PS | |
| %%DocumentMedia: a4 595 842 80 () () | |
| /pageHeight 842 def | |
| /pageWidth 595 def | |
| << /PageSize [pageWidth pageHeight] >> setpagedevice | |
| /mm { 2.834645669 mul } def |