Skip to content

Instantly share code, notes, and snippets.

View csebille's full-sized avatar

Christophe SEBILLE csebille

View GitHub Profile

screencast linux

man script :

   -f, --flush
          Flush  output  after  each  write.  This is nice for telecooperation: one person does `mkfifo foo; script -f foo', and another can supervise real-time what is
          being done using `cat foo'.

Centos 7

Gestion des proxies

@csebille
csebille / squash-commits.sh
Created November 8, 2018 12:10 — forked from jbub/squash-commits.sh
git squash last two commits into one
git rebase --interactive HEAD~2
# we are going to squash c into b
pick b76d157 b
pick a931ac7 c
# squash c into b
pick b76d157 b
s a931ac7 c
# List packages
import pkgutil
for importer, modname, ispkg in pkgutil.walk_packages(path=None, onerror=lambda x: None):
print(modname)
# Import class dynamically
class_name = 'ShellAdapter'
requested_adapter_module = importlib.import_module('pybot.adapters.shell', 'pybot.adapters')
@csebille
csebille / configure_docker0.sh
Created February 21, 2018 09:40 — forked from kamermans/configure_docker0.sh
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/kamermans/94b1c41086de0204750b/raw/configure_docker0.sh | sudo bash -s - 192.168.254.1/24
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then
@csebille
csebille / pdf-tricks
Created November 2, 2017 14:21
pdf-tricks
pdfmod : GUI pdf
1 View pdf metadata for a file called Example.pdf:
pdfinfo Example.pdf
2 Edit existing metadata in the terminal using nano editor:
pdftk Example.pdf dump_data output Metadata-output.txt
nano Metadata-output.txt
3 Update metadata:
pdftk Example.pdf update_info Metadata-output.txt output Example-new.pdf
https://medium.com/js-dojo/reactivity-in-vue-js-and-its-pitfalls-de07a29c9407
https://medium.freecodecamp.org/modern-frontend-hacking-cheatsheets-df9c2566c72a
#############################
##
## 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() {
@csebille
csebille / Top5_LiveJournalPageRank.scala
Created April 20, 2017 15:37
[Spark] Get top 5 from LiveJournalPageRank result file
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
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
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