Skip to content

Instantly share code, notes, and snippets.

Francesco Frassinelli frafra

Block or report user

Report or block frafra

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
@frafra
frafra / share-connection.sh
Created May 2, 2014
Wifi connection over ethernet (Fedora setup)
View share-connection.sh
### /etc/sysconfig/network-scripts/ifcfg-*
### NM_CONTROLLED=no
cat << EOF > /etc/dnsmasq.conf
# Only listen to routers' LAN NIC. Doing so opens up tcp/udp port 53 to
# localhost and udp port 67 to world:
interface=p255p1
# dnsmasq will open tcp/udp port 53 and udp port 67 to world to help with
# dynamic interfaces (assigning dynamic ips). Dnsmasq will discard world
@frafra
frafra / ydlredirect-bookmarklet.js
Created Aug 29, 2014
(youtube-dl) + web service + bookmarklet = play just the video/no Flash
View ydlredirect-bookmarklet.js
javascript:(function(){window.location='http://localhost:8080?url='+window.btoa(unescape(encodeURIComponent(window.location)));})()
@frafra
frafra / did-i-forget-to-backup-something.py
Last active Aug 29, 2015
Check if there are missing files in your backup (based on filenames)
View did-i-forget-to-backup-something.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Francesco Frassinelli
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
View viglug-meeting.py
from datetime import date
for y in [2015]:
for m in range(12):
for d in [1, 19]: # first monday, third friday (7*2+5)
print(date(y, m+1, (7-date(y, m+1, 1).weekday())%7+d))
@frafra
frafra / conway-bruteforce.py
Created Nov 9, 2014
Conway's game of life: looking for repeating patterns
View conway-bruteforce.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Francesco Frassinelli <fraph24@gmail.com>
#
# pylife is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
View frafra-display-levenshtein.py
#!/usr/bin/env python
#
# frafra-display-levenshtein.py
#
# Copyright (C) 2014 - Francesco Frassinelli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
@frafra
frafra / ext4-checksum.sh
Created Jan 9, 2015
ext4 with checksums
View ext4-checksum.sh
#!/bin/bash
#
# By Frafra (http://frafra.eu)
#(shopt -s globstar;
# for f in **
# do
# if [ -f "$f" ]
# then
# echo -ne "$f\0"
@frafra
frafra / email-archiver.py
Created Feb 7, 2015
Save your emails to file (both content and attachments)
View email-archiver.py
#!/usr/bin/env python
#! coding: utf-8 -*-
#
# email-archiver.py
#
# Copyright (C) 2015 - Francesco Frassinelli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
@frafra
frafra / nmcli-remove-manual-dns.sh
Created Feb 18, 2015
Remove manual DNS entries from active connections using nmcli
View nmcli-remove-manual-dns.sh
#!/bin/bash
for id in $(nmcli -t -f UUID c s -a)
do
dnss=$(nmcli -t -f ipv4.dns c s $id | cut -d: -f2- | tr -d ,)
for dns in $dnss
do
nmcli c m $id -ipv4.dns 0
done
done
@frafra
frafra / cisco-fwsm-parser.py
Created Feb 19, 2015
CISCO FWSM parser (draft)
View cisco-fwsm-parser.py
#!/usr/bin/env python3
#
# cisco-fwsm-parser.py
#
# Copyright (C) 2015 - Francesco Frassinelli
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
You can’t perform that action at this time.