Skip to content

Instantly share code, notes, and snippets.

Avatar

guyzmo guyzmo

View GitHub Profile
@guyzmo
guyzmo / nm-wifi-fzf.sh
Created May 28, 2017
Connect to Wifi networks using network manager listed by fzf
View nm-wifi-fzf.sh
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 Apr 27, 2017
Afew Filter: Auto-tag thread filter
View autotag_filter.py
#!/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 Apr 20, 2017
Example of title failure
View test.html
<!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 Mar 10, 2017
float_random snippet
View float_random.adb
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 Mar 10, 2017
exercise advanced checkpoint
View exercise_advanced_checkpoint.adb
-- 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
View int_list_pkg.adb
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 Mar 6, 2017
gprbuild build log
View 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 Feb 19, 2017
first functional test case for neomutt
View busted_functional.log
+++++++++++++
13 successes / 0 failures / 0 errors / 0 pending : 0.020419 seconds
@guyzmo
guyzmo / busted.log
Last active Feb 19, 2017
first unit test case for neomutt
View busted.log
+++++
5 successes / 0 failures / 0 errors / 0 pending : 0.099498 seconds
@guyzmo
guyzmo / git.weboob.org-ipv4-curl.log
Created Feb 18, 2017
IPv6 Connection issue to git.weboob.org
View git.weboob.org-ipv4-curl.log
* 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):