Skip to content

Instantly share code, notes, and snippets.

View csebille's full-sized avatar

Christophe SEBILLE csebille

View GitHub Profile
https://medium.com/js-dojo/reactivity-in-vue-js-and-its-pitfalls-de07a29c9407
https://medium.freecodecamp.org/modern-frontend-hacking-cheatsheets-df9c2566c72a
@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
@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
# 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 / 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

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 / pyspark.md
Created March 25, 2019 17:41
pyspark

autocompletion dans pyspark shell

import rlcompleter, readline
readline.parse_and_bind('tab: complete')
@csebille
csebille / abricotine_tips.md
Last active April 30, 2019 15:40
abricotine tips

To remove top, left and right margins in Abricotine, change theme.less file with :

.CodeMirror-code { margin-top: 10px; }

.CodeMirror-sizer { max-width: 90em; width: 90em; }

Use local ansible to locally render jinja files

echo "Hello {{ name }} ! " > hello-world.j2
ansible all -vv --connection=local -i "localhost," -m template -a"src=hello-world.j2 dest=hello-result.txt" -e name=Toto

import paramiko.client
client = paramiko.client.SSHClient()
client.set_missing_host_key_policy(paramiko.client.AutoAddPolicy)
client.connect("cnp31pbd-nifi.cer31.recouv",username="nifi",password="nifi")
stdin, stdout, stderr = client.exec_command('ls -l')
out = stdout.read().decode('utf-8')
print(out)