Skip to content

Instantly share code, notes, and snippets.

code for food

Gianluca Pacchiella gipi

code for food
View GitHub Profile
gipi / client.c
Created May 21, 2012
Unix socket
View client.c
#include <stdio.h>
#include <sys/socket.h>
#include <linux/un.h>
#include <unistd.h>
#include <string.h>
int main(void)
struct sockaddr_un address;
int socket_fd, nbytes;
gipi / icecast.xml
Created Feb 21, 2012
Simple configuration file for icecast2 server
View icecast.xml
gipi /
Last active May 3, 2020
Split a patch created with repo diff in a set of usable patches
## Script to patch up diff reated by `repo diff`
# from
if [ -z "$1" ] || [ ! -e "$1" ]; then
echo "Usages: $0 <repo_diff_file>";
exit 0;
rm -fr _tmp_splits*
gipi /
Last active Jul 18, 2019
Crea dei CSV con l'elenco degli indirizzi PEC dei vari comuni italiani. Dalla pagina principale recupera l'URL delle singole regioni da cui crea il corrispondente CSV.
import re
from pathlib import Path
import os
import sys
import requests
import logging
gipi / Manifest.plist
Created Oct 21, 2011
Creating a home page to download an In House ad hoc iphone application
View Manifest.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
gipi /
Last active Jun 3, 2019
#debian #package: notes about building packages.

The dependencies needed for build package from source are

# sudo apt-get install build-essential fakeroot devscripts dpatch dh-make expect

to build a package obviously you need the source and its dependencies

$ apt-get source blender
# apt-get build-dep blender

and finally you can build it

gipi /
Last active May 25, 2019
#lxc #container #linux


Install the package lxc lxc-stuffs, and configure the cgroup mount entry in /etc/fstab

cgroup    /sys/fs/cgroup    cgroup    defaults    0    0

If is the first time mount it (# mount /sys/fs/cgroup). The final check can be done with lxc-checkconfig.

Create containers