Skip to content

Instantly share code, notes, and snippets.

View bwnyasse's full-sized avatar
🎯
Focusing

Boris-Wilfried bwnyasse

🎯
Focusing
View GitHub Profile
[
{ "keys": ["f12"], "command": "htmlprettify"},
{ "keys": ["f1"], "command": "fold" },
{ "keys": ["f2"], "command": "unfold" },
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
@bwnyasse
bwnyasse / gist:d3de367562b590f3abb2
Last active April 15, 2017 23:38
Docker CLI Memo - List of useful docker command for Terminal
// Copy data volume from Host to antoher
docker run --rm -v <SOURCE_DATA_VOLUME_NAME>:/from alpine ash -c "cd /from ; tar -cf - . " | ssh <TARGET_HOST> 'docker run --rm -i -v <TARGET_DATA_VOLUME_NAME>:/to alpine ash -c "cd /to ; tar -xpvf - " '
// Inspect a running container
> cid=$(docker run -itd NAME)
> docker inspect $cid
// Running Container ID
> docker ps -q
@bwnyasse
bwnyasse / camera.html
Created March 22, 2016 08:35 — forked from dhavaln/camera.html
Phonegap Camera Capture Example
<!DOCTYPE html>
<html>
<head>
<title>Capture Photo</title>
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1"/>
<script type="text/javascript" charset="utf-8" src="js/phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
var pictureSource; // picture source
var destinationType; // sets the format of returned value
@bwnyasse
bwnyasse / tmux-cheatsheet.markdown
Created April 27, 2016 20:17 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#Upgrade Ubuntu OS Version
dpkg --configure -a && apt-get -f install && apt-get update && apt-get dist-upgrade && apt-get autoremove && apt-get clean
@bwnyasse
bwnyasse / apt-remove-duplicate-source-entries.py
Created May 22, 2016 22:22 — forked from davidfoerster/gist:780daa8086b924b1837a06cc486af672
Detect and deactivate duplicate Apt source entries (as requested in https://askubuntu.com/a/762815/175814).
#!/usr/bin/env python3
"""
Detects and interactively deactivates duplicate Apt source entries.
Usage: python3 apt-remove-duplicate-source-entries.py
"""
from __future__ import print_function
import aptsources.sourceslist
@bwnyasse
bwnyasse / commandList.md
Last active September 11, 2016 16:26
Pense Bête Administration Linux

uname Affiche le nom du système et la version du noyau.

uname –a Affiche notamment la version du noyau.

cat /etc/*-release ou lsb_release –a Affiche la distribution et sa version.

cat /etc/issue Idem, mais le contenu est modifiable. Ce fichier est affiché avant la connexion.

date Affiche la date et l’heure système.

@bwnyasse
bwnyasse / main.dart
Created August 8, 2016 21:41 — forked from anonymous/main.dart
Sample use case Regular Expression 
void main() {
///
/// sample using regexp to parse log
///
RegExp regExp = new RegExp(r"^(.*m)(\d{1,2}:\d{1,2}:\d{1,2},\d{1,3}) ([^\s]+) (.*)");
var input ="""
[0m[31m22:25:57,366 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."bad.war"
""";
var matches = regExp.allMatches(input);
@bwnyasse
bwnyasse / extract-git-folder-with-history.md
Created August 9, 2016 22:56 — forked from cyberang3l/extract-git-folder-with-history.md
GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

GIT: How to extract a specific folder from a git repository branch, including the folder's related git history only

NOTE: If you want to keep the history for a specific folder in the master branch, just skip steps in lines 3,4,5,6,7

git clone <git-repository-url>
cd <git-repository-dir>

git checkout <branch-name>              # line 3; Checkout the branch of interest
git merge --strategy=ours master        # line 4; keep the content of this branch only and record a merge
git checkout master                     # line 5; Go back to the master branch
@bwnyasse
bwnyasse / decisionControl.md
Last active October 18, 2016 12:45
Shell Scripting - Quick Memo

Decision Control Structures

File-based condition

Operator Description

-a file	Returns true if file exists
-b file	Returns true if file exists and is a block special file
-c file	Returns true if file exists and is a character special file