Skip to content

Instantly share code, notes, and snippets.

@guyzmo
guyzmo / nm-wifi-fzf.sh
Created May 28, 2017 09:09
Connect to Wifi networks using network manager listed by fzf
wl(){
local ssid
local conn
nmcli device wifi rescan > /dev/null
ssid=$(nmcli device wifi list | tail -n +2 | grep -v '^ *\B--\B' | fzf -m | sed 's/^ *\*//' | awk '{print $1}')
if [ "x$ssid" != "x" ]; then
# check if the SSID has already a connection setup
conn=$(nmcli con | grep "$ssid" | awk '{print $1}' | uniq)
@guyzmo
guyzmo / autotag_filter.py
Created April 27, 2017 19:42
Afew Filter: Auto-tag thread filter
#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function, absolute_import, unicode_literals
from afew.filters.BaseFilter import Filter
from afew.FilterRegistry import register_filter
@register_filter
@guyzmo
guyzmo / test.html
Created April 20, 2017 16:05
Example of title failure
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<title>Status Constitutifs — {{Company_Name}}</title>
<style>
/* CSS RESET */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@guyzmo
guyzmo / float_random.adb
Last active March 10, 2017 14:22
float_random snippet
with Ada.Numerics.Float_Random;
declare
Seed : Ada.Numerics.Float_Random.Generator;
begin
delay Duration (Ada.Numerics.Float_Random.Random (Seed) * 0.500);
end
@guyzmo
guyzmo / exercise_advanced_checkpoint.adb
Created March 10, 2017 12:52
exercise advanced checkpoint
-- Consider a workshop where several workers (tasks) assembly details of some mechanism. When each of them completes his work they put the details together. There is no store, so a worker who finished its part first must wait for others before starting another one. Putting details together is the checkpoint at which tasks synchronize themselves before going their paths apart.
--
-- The task
-- Implement checkpoint synchronization in your language.
-- Make sure that the solution is race condition-free.
-- Note that a straightforward solution based on events is exposed
-- to race condition. Let two tasks A and B need to be synchronized
-- at a checkpoint. Each signals its event (EA and EB correspondingly),
-- then waits for the AND-combination of the events (EA&EB) and resets
-- its event. Consider the following scenario: A signals EA first and
@guyzmo
guyzmo / int_list_pkg.adb
Created March 9, 2017 11:15
int_list_pkg
package Int_List_Pkg is
type Int_List (Max_Length : Natural) is private
with Type_Invariant => Is_Sorted (Int_List);
function Is_Sorted (List : Int_List) return Boolean;
type Int_array is array (Positive range <>) of Integer;
function To_Int_List (Ints : Int_Array) return Int_List;
@guyzmo
guyzmo / build.log
Created March 6, 2017 09:43
gprbuild build log
-> Found Makefile.archy
-> Found patch-configure.in
==> Validating source files with sha1sums...
57399662c7a447658e0affa8 ... Passed
Makefile.archy ... Passed
patch-configure.in ... Passed
==> Extracting sources...
-> Extracting 57399662c7a447658e0affa8 with bsdtar
==> Starting prepare()...
patching file configure.in
@guyzmo
guyzmo / busted_functional.log
Created February 19, 2017 02:15
first functional test case for neomutt
+++++++++++++
13 successes / 0 failures / 0 errors / 0 pending : 0.020419 seconds
@guyzmo
guyzmo / busted.log
Last active February 19, 2017 02:38
first unit test case for neomutt
+++++
5 successes / 0 failures / 0 errors / 0 pending : 0.099498 seconds
@guyzmo
guyzmo / git.weboob.org-ipv4-curl.log
Created February 18, 2017 19:41
IPv6 Connection issue to git.weboob.org
* Rebuilt URL to: https://git.weboob.org/
* Trying 136.243.171.154...
* TCP_NODELAY set
* Connected to git.weboob.org (136.243.171.154) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):