Skip to content

Instantly share code, notes, and snippets.

jkstill / proc_net_tcp_decode
Last active Aug 15, 2020
decode entries in /proc/net/tcp
View proc_net_tcp_decode
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
joemiller /
Last active Jul 29, 2020
shell: quick linux scripts for showing network bandwidth or packets-per-second
if [ -z "$1" ]; then
echo usage: $0 network-interface
echo e.g. $0 eth0
echo shows packets-per-second
View _Example polkit

These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API. These examples are for polkit versions 106 and later, with the JS interpreter. They won't work with Debian's polkit v105.

  • If you don't know the action name, run pkaction:

    pkaction | grep cups
  • The possible results are YES, AUTH_SELF(_KEEP), AUTH_ADMIN(_KEEP), NO. Returning a result is final. Returning null will continue checking other rules.

  • Put your rules in /etc/polkit-1/rules.d/*.rules. (You can check everything in one giant addRule, or you can have a separate file and separate addRule for each program; it doesn't matter.)

deanet /
Created Aug 22, 2012
Uploading File into Google Drive (because grive too many dependencies qt, xorg ? )
## uploading to google
## rev: 22 Aug 2012 16:07
det=`date +%F`
browser="Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0.1"
accountype="HOSTED" #gooApps = HOSTED , gmail=GOOGLE
betacar / config.xml
Created Jan 3, 2012
Mediatomb configuration file + subtitle script
View config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config version="2" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
Read /usr/share/doc/mediatomb-common/README.gz section 6 for more
information on creating and using config.xml configration files.
<ui enabled="yes" show-tooltips="yes">
<accounts enabled="no" session-timeout="30">
<account user="mediatomb" password="mediatomb"/>
You can’t perform that action at this time.