Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
code for food

Gianluca Pacchiella gipi

😎
code for food
View GitHub Profile
@gipi
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
gipi / icecast.xml
Created Feb 21, 2012
Simple configuration file for icecast2 server
View icecast.xml
<icecast>
<limits>
<clients>100</clients>
<sources>2</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
@gipi
gipi / repo-apply.sh
Last active May 3, 2020
Split a patch created with repo diff in a set of usable patches
View repo-apply.sh
#!/bin/sh
## Script to patch up diff reated by `repo diff`
# from https://groups.google.com/d/msg/repo-discuss/43juvD1qGIQ/7maptZVcEjsJ
if [ -z "$1" ] || [ ! -e "$1" ]; then
echo "Usages: $0 <repo_diff_file>";
exit 0;
fi
rm -fr _tmp_splits*
@gipi
gipi / pec.py
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.
View pec.py
import re
from pathlib import Path
import os
import sys
import requests
import logging
logging.basicConfig()
@gipi
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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
@gipi
gipi / 000.md
Last active Jun 3, 2019
#debian #package: notes about building packages.
View 000.md

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
gipi / README.md
Last active May 25, 2019
#lxc #container #linux
View README.md

Setup

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