Skip to content

Instantly share code, notes, and snippets.

Daniel Lamblin dlamblin

Block or report user

Report or block dlamblin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dlamblin
dlamblin / ngram.py
Last active Mar 7, 2019
Python N-Gram for characters in string
View ngram.py
"""
n-gram of a string by characters (not by words)
takes all args as input unless the first two args are numbers which are in
order, then it assume these are min and max length. Default min max is 2 - 60
"""
def ngram(inp='', mn=2, mx=60):
"""
@dlamblin
dlamblin / powers_of_2_in_decimal.pl
Created Dec 12, 2018
Print Powers of 2 to 2^64
View powers_of_2_in_decimal.pl
#!/usr/bin/env perl
use bignum;
$a=1;
for(0..64){
printf "%2s%21s\n", $_, $a;
$a<<=1;
}
# (perl)$ perl -Mbignum -E '$a=1;for(0..64){say" "x($_<10).$_." "x(21-length($a)).$a;$a<<=1}'
# (perl)$ perl -Mbignum -E '$a=1;for(0..64){printf"%2s%21s\n",$_,$a;$a<<=1}'
@dlamblin
dlamblin / copy_one_line_per_sec.bash
Last active Nov 26, 2018
Subscribing to an AWS region's status RSS feeds in slack
View copy_one_line_per_sec.bash
sleep 5; while read -r line; do clear; echo $line; echo "$line" | pbcopy; sleep 1; done < "feed_commands_for_seoul_ap-northeast-2.txt"
@dlamblin
dlamblin / swisscom_Internet-Box_os-licenses.html
Last active Jul 25, 2018
Open Source Licences page of Swisscom Internet Box 2
View swisscom_Internet-Box_os-licenses.html
Open Source License List (not included at https://www.swisscom.ch/en/residential/help/device/open-source.html)
<div class="base-content">
<div class="text description"> <span class="translation-string">Swisscom adopts a careful approach to the open source software used in its products. Use the links below to access the websites of the open source software components used. For more information and open source contact details of the Internet-Box software suppliers go to <a href="http://www.swisscom.ch/opensource">here</a>.</span> </div>
<div class="license-container">
<div class="license-name"> <a href="/static/licenses/AP/stargatev2/avahi-LICENSE.txt" target="_blank">avahi</a> </div>
<div class="license-site"> <a href="https://github.com/lathiat/avahi/releases/tag/v0.6.32" target="_blank">https://github.com/lathiat/avahi/releases/tag/v0.6.32</a> </div>
</div>
<div class="license-container">
<div class="license-name"> <a href="/static/licenses/AP/stargatev2/dbus-COPYING.t
@dlamblin
dlamblin / extract_deb_filelist.sh
Created Oct 26, 2017
Extract a deb's files on Mac OS with tar
View extract_deb_filelist.sh
tar -xOf $1 data.tar.xz |tar -tv
You can’t perform that action at this time.