Skip to content

Instantly share code, notes, and snippets.

@gipi
gipi / roundcube
Created December 28, 2011 10:49
ROUNDCUBE: Init script for PHP CGI and nginx configuration file.
#!/bin/sh
### BEGIN INIT INFO
# Provides: php-cgi
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Make available a cgi for nginx
# Description: primarly is used for the wordpress installation
### END INIT INFO
@sta1r
sta1r / wp-strip-css-js
Created July 18, 2012 16:57
Removing Wordpress plugin scripts and styles
/* Remove plugin CSS & JS */
/* Next Gen Gallery */
function dequeue_nextGen_style() {
wp_dequeue_style('NextGEN');
}
add_action('template_redirect', 'dequeue_nextGen_style');
function dequeue_nextGen_js() {
if (!is_singular()) {
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@oro350
oro350 / rawfilter.c
Created January 5, 2014 15:46
SO_ATTACH_FILTER usage
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <netpacket/packet.h>
@giu1io
giu1io / load_wifi.sh
Last active February 24, 2024 10:00
Shell script that loads the WPA_supplicant configuration and use it to connect to available networks, if none is available it an AP is created. Include Wi-Fi watchdog service that checks that the connection is always working.
#!/bin/bash
WPA_SUPPLICANT_CONF="/etc/wpa_supplicant/wpa_supplicant.conf"
# this funcion is called once the connection is established,
# in this case a boot sound will be played to notify the user that everything is ready.
function connected {
aplay /root/Windows3.1.wav 2>&1 >/dev/null &
}

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@addminuse
addminuse / Forwarding.py
Created December 2, 2015 09:02
Enable port forwarding using this simple python script.
#/usr/bin/python
# if yes or no doesn't work try using quotes
# example 'yes' or 'no'
import os
import sys
@cbarraco
cbarraco / ffmpeg screen sharing
Last active December 24, 2023 09:46
The poor man's VNC. If you have ffmpeg and netcat you can stream your screen across your network with two one-liners
# If the server has ffmpeg:
## For the server:
ffmpeg -f fbdev -i /dev/fb0 -f avi pipe:1 | nc -l -p 1234
## For the viewer:
nc 127.0.0.1 1234 | ffplay -i pipe:0
# If the server doesn't have ffmpeg:
## For the server:
sudo cat /dev/fb0 | nc -l -p 1234
## For the viewer (replace 1920x1080 with the server's resolution):
@streetgt
streetgt / youtube_comment_bot.py
Last active January 15, 2022 13:04
Youtube Comment Bot - python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python bot for comment a list of urls in YouTube
import time
import numpy as np
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
@Brainiarc7
Brainiarc7 / ffmpeg-desktop-livestreaming-nvenc-and netcat.md
Last active December 13, 2023 03:27
This gist will show you how to livestream your Linux desktop to a client via FFMpeg using a GPU-accelerated video encoder (NVENC and VAAPI-based)

Low-Latency Live Streaming for your Desktop using ffmpeg and netcat:

Preamble:

In this post I will explore how to stream a video and audio capture from one computer to another using ffmpeg and netcat, with a latency below 100ms, which is good enough for presentations and general purpose remote display tasks on a local network.

The problem:

Streaming low-latency live content is quite hard, because most software-based video codecs are designed to achieve the best compression and not best latency. This makes sense, because most movies are encoded once and decoded often, so it is a good trade-off to use more time for the encoding than the decoding.