Driver Intel, supprimer les autres si ils ont été ajoutés
# pacman -S xf86-video-intel xf86-input-synaptics
/* | |
* This is a simple example of va_list function in ncurses. | |
* I use it to wrap mvwprintw() and print something in a footer. | |
* | |
* How to run: | |
* gcc -o test va_list_ncurses.c -lncurses | |
*/ | |
#include <ncurses.h> | |
#include <stdarg.h> | |
#include <stdio.h> |
// Preparation for method 1 | |
use benchmark; | |
print("Method 1, preparation start."); | |
db.col.ensureIndex( { random_point: '2d' } ); | |
// This feels ugly... | |
db.col.find().map(function(u) { | |
db.col.update( |
public class progressbar { | |
public static void main( String[] args ) { | |
System.out.println( "[*] Running ..." ) ; | |
for ( int i = 1 ; i < 101 ; i++ ) { | |
System.out.flush() ; | |
System.out.print( "\r " + ( i == 100 ? "100" : " " + ( i < 10 ? " " + i : i) ) + " % " ) ; | |
System.out.print( "[" ) ; | |
for ( int j = 0 ; j < i-1 ; j++ ) { System.out.print( "=" ) ; } |
#!/bin/bash | |
# This simple helper script toggle the mute attribute for a program in pulseaudio. | |
PROG="Chromium" | |
all=$(pacmd list-sink-inputs | egrep -B 15 "client: [0-9]+ <${PROG}>" | sed -n '1p;8p') | |
index=${all:11:2} # get the index | |
muted=${all:22:3} # get 'yes' or 'no' |
from scapy.all import * | |
ip_dst = "104.16.34.249" | |
for i in range(1, 65536): | |
ans,uns = sr(IP(dst=ip_dst) / TCP(dport=i, flags="S"), timeout=1, retry=-2, verbose=False) | |
try: | |
if ans[0][1].getlayer(TCP).flags & 0x12 == 0x12: | |
print str(i) + " is open" |
#!/bin/bash | |
check_args=${@:?You forgot the markdown file(s) as arg} | |
cat << EOF | |
<html> | |
<head> | |
<title></title> | |
<!-- Bootstrap css themes --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> |
# Install graphviz using pip3 (on archlinux): | |
# $ sudo pip3 install graphviz | |
import graphviz as gv | |
g1 = gv.Graph(format="svg") # "svg" or "dot" | |
g1.node('A') | |
g1.node('B') | |
g1.node('C') | |
g1.edge('A', 'C') | |
g1.edge('B', 'C') |
__main__.function_to_benchmark|0:00:00.000172 | |
__main__.function_to_benchmark|0:00:01.001560 | |
__main__.function_to_benchmark|0:00:02.001992 |