Skip to content

Instantly share code, notes, and snippets.

Avatar

Lorenzo Fontana fntlnz

View GitHub Profile
View xrandr-examples.md

Put projector DP1 right to built in screen eDP1

xrandr --output eDP1 --auto --primary --output DP1 --auto --right-of eDP1
@fntlnz
fntlnz / i3wm-fedora.md
Last active Dec 28, 2020
i3wm fedora lightdm
View i3wm-fedora.md

Install i3

dnf install i3

Add exec i3 to xinitrc

echo "exec i3" > ~/.xinitrc
View dns-check.php
<?php
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$i = 0;
$maxTime = 0;
@fntlnz
fntlnz / tests.md
Last active Aug 29, 2015
PHPUnit PHP (5.5.16, 5.6.11, 7.0.0alpha1, 7.0.0beta1, 7.0.0beta2)
View tests.md

PHP 5.5.16

PHPUnit 4.7.6 by Sebastian Bergmann and contributors.

Runtime:        PHP 5.5.16
Configuration:  /project/phpunit.xml.dist

...............................................................  63 / 144 ( 43%)
............................................................... 126 / 144 ( 87%)
View docker-compose.yml
nginx:
image: fntlnz/nginx
volumes:
- docker/nginx/conf:/usr/local/nginx/conf
- docker/nginx/logs:/usr/local/nginx/logs
volumes_from:
- fpm
links:
- fpm:fpm
@fntlnz
fntlnz / docker-compose.yml
Created Jun 10, 2015
Drone on Docker With Nginx and Drone Wall
View docker-compose.yml
drone:
image: drone/drone
restart: always
privileged: true
volumes:
- /data/drone:/var/lib/drone
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DRONE_SESSION_SECRET=yoursessionsecrethere
- DRONE_GITHUB_CLIENT=yourgithubclientkey
@fntlnz
fntlnz / sysctl.conf
Created Jun 9, 2015
/etc/sysctl.conf tuning
View sysctl.conf
# Recycle Zombie connections
net.inet.tcp.fast_finwait2_recycle=1
net.inet.tcp.maxtcptw=200000
# Increase number of files
kern.maxfiles=65535
kern.maxfilesperproc=16384
# Increase page share factor per process
vm.pmap.pv_entry_max=54272521
View CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
find_package(BISON)
find_package(FLEX)
add_definitions(-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS)
BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
FLEX_TARGET(MyScanner tokens.l ${CMAKE_CURRENT_BINARY_DIR}/tokens.cpp)
ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
@fntlnz
fntlnz / wait-ready-service-docker.md
Created May 20, 2015
Wait for ready service in docker container
View wait-ready-service-docker.md
until nc -z $(docker inspect --format='{{.NetworkSettings.IPAddress}}' $CONTAINER_NAME) $SERVICE_PORT; do echo "waiting for service in container..."; sleep 0.5; done
@fntlnz
fntlnz / icu.md
Created Jan 15, 2015
Build ICU from source
View icu.md
wget http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.tgz
tar -xvf icu4c-54_1-src.tgz
cd icu/source
./configure
make -j
make install