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
import org.apache.commons.csv.CSVFormat; | |
import org.apache.commons.csv.CSVRecord; | |
import java.io.*; | |
import java.math.BigDecimal; | |
import java.net.URL; | |
import java.sql.*; | |
import java.util.Calendar; | |
import java.util.Map; |
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
export X=$(wc -l file_to_copy.txt | cut -d ' ' -f 1); export X_INIT=${X}; export line_count=15; | |
let nb_lines=$((X_INIT - X)); tail -n +${nb_lines} file_to_copy.txt | head -${line_count}; let X=$((X - line_count - 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
# Override cd comamnd to print current git branch in the prompt | |
cd () { | |
builtin cd $1 | |
current_git_branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/') | |
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;34m\]\u\[\033[00m\]:\w \[\033[01;32m\]${current_git_branch}\[\033[00m\]> " | |
} | |
alias rtl='ls -rtl' | |
alias gds='gsutil ls -l ' |
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
If your Java process is running on Linux behind a firewall and you want to start JConsole / Java VisualVM / Java Mission Control on Windows on your local machine to connect it to the JMX Port of your Java process. | |
You need access to your linux machine via SSH login. All Communication will be tunneled over the SSH connection. | |
TIP: This Solution works no matter if there is a firewall or not. | |
Disadvantage: Everytime you restart your java process, you will need to do all steps from 4 - 9 again. | |
1. You need the putty-suite for your Windows machine from here: |
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 | |
group_name=$1 | |
script_location=`dirname $0` | |
script_name=`basename $0` | |
COMMANDS=$(grep Exec ${script_location}/group-${group_name}.desktop |grep -v ${script_name}| sed -e 's/Exec\=/FALSE /g ' |xargs) | |
CHOICE=$(zenity --list --text "Which ?" --radiolist --column "Pick" --column "opinion" ${COMMANDS}) |
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
function ip_hash() { | |
# Get a file | |
FILE=$(ls *_flux_audience.txt) | |
TEMP=$(mktemp -d) | |
ORIGINAL_FILE_COPY=$(mktemp -p ${TEMP} ${FILE}_original_XXXXXXXXXXXXX) | |
# Save the original file, just in case | |
cp ./${FILE} ${ORIGINAL_FILE_COPY} | |
#Remove header and extract relevant data | |
let R=$(wc -l ${FILE} |awk '{print $1}')-1 | |
tail -${R} ${FILE} |cut -d '|' -f 12 |sort -u > $TEMP/ips |
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
Supprimer tous les espaces dans un fichier : | |
:%s/ //g | |
Supprimer tous les espaces en début de ligne : | |
:%le | |
Shorter keystroke than :w | |
nnoremap ZS :w<cr> into your .vimrc |
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
https://swagger.io | |
https://swaggerhub.com | |
https://apihandyman.io/do-you-really-know-why-you-prefer-rest-over-rpc/ | |
https://apihandyman.io/ -> Arnaud Lauret https://www.linkedin.com/in/arnaudlauret/ | |
# graphQL | |
https://github.com/APIs-guru/graphql-apis | |
https://github.com/APIs-guru/graphql-voyager | |
https://github.com/NathanRSmith/graphql-visualizer |
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
import scala.io.Source | |
// This file is the result of the graphx LiveJournalPageRank example | |
// it contains for each line an id and a rank (separated by a tab character) | |
val filename="/opt/spark-2.1.0-bin-hadoop2.6/examples/src/main/scala/org/apache/spark/examples/graphx/sortie_1000004_1/part-00000" | |
val ranks = Source.fromFile(filename).getLines().toList | |
// Here each line is split then reversed | |
// The list is then sorted and only the five top elements are printed |
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
############################# | |
## | |
## Dynamic function call | |
## | |
############################# | |
if_it_exists_launch_function clean_before_${JOB_NICKNAME} | |
# This function calls another function, if it exists | |
function if_it_exists_launch_function() { |
OlderNewer