Skip to content

Instantly share code, notes, and snippets.

@xabbu
xabbu / gist:467927f8c8bec3fe8bd8eed2cfea09f7
Created February 28, 2018 03:56
configure and simple nginx conf
./configure --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --with-http_ssl_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module --add-module=../ngx_brotli
# configuration file /etc/nginx/nginx.conf:
user www-data;
pid /run/nginx.pid;
events {
worker_connections 768;
}
curl -o Lorem5000.txt.br -H 'Accept-encoding: br' http://debian-test.local/Lorem5000.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10104 0 10104 0 0 1644k 0 --:--:-- --:--:-- --:--:-- 1644k
[28/Feb/2018:03:45:28 +0100] "GET /Lorem5000.txt HTTP/1.1" 200 10117 gzip - br 3.24
brotli -t Lorem5000.txt.br
corrupt input [Lorem5000.txt.br]
This file has been truncated, but you can view the full file.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur mollis facilisis purus eget gravida. Duis dignissim volutpat turpis eget vulputate. Etiam augue justo, euismod et neque sit amet, porta maximus felis. Sed mollis tempor ipsum sit amet elementum. Vivamus maximus enim vel gravida venenatis. Quisque mauris nulla, condimentum porttitor tempus in, sollicitudin quis leo. Mauris mollis nunc eget risus ultricies imperdiet. Aenean sed erat vel massa elementum tempus.
Cras lacinia, lacus rhoncus vulputate pellentesque, ex risus tincidunt risus, quis consequat enim erat nec felis. Mauris faucibus sagittis tempus. Sed consequat sit amet ex a volutpat. Aenean non ligula lacus. Nunc vitae sem lobortis, efficitur tellus vel, bibendum elit. Sed feugiat scelerisque urna, at luctus ex lobortis a. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Pellentesque sit amet auctor enim. Aenean vehicula nisi eget nisi hendrerit vulputate. Curabitur quis magna mattis, aliqua
$ nginx -V
nginx version: nginx/1.13.9
built by gcc 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
built with OpenSSL 1.1.0f 25 May 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --with-http_ssl_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module --add-module=../ngx_brotli
$ nginx -T
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
@xabbu
xabbu / journal systemd-cryptsetup Failed to deactivate
Created March 16, 2018 21:09
systemd-cryptsetup Failed to deactivate error
Mär 15 16:50:40 Home systemd[1199]: Reached target Shutdown.
Mär 15 16:50:40 Home systemd[1199]: Starting Exit the Session...
Mär 15 16:50:40 Home systemd[1199]: Received SIGRTMIN+24 from PID 6127 (kill).
Mär 15 16:50:40 Home systemd[1]: Stopped User Manager for UID 1000.
Mär 15 16:50:40 Home systemd[1]: Removed slice User Slice of xabbu.
Mär 15 16:50:40 Home systemd[1]: Stopping Permit User Sessions...
Mär 15 16:50:40 Home systemd[1]: Stopping Login Service...
Mär 15 16:50:40 Home systemd[1]: Stopped Permit User Sessions.
Mär 15 16:50:40 Home systemd[1]: Stopped target Network.
Mär 15 16:50:40 Home systemd[1]: Stopping Network Manager...
@xabbu
xabbu / PKGBUILD
Created March 30, 2018 08:34
PKGBUILD for gjs
# $Id$
# Contributor: Ionut Biru <ibiru@archlinux.org>
pkgname=gjs
pkgver=1.50.4
pkgrel=2
epoch=1
pkgdesc="Javascript Bindings for GNOME"
url="https://wiki.gnome.org/Projects/Gjs"
arch=(x86_64)
@@ -2,7 +2,7 @@
# Contributor: Richard Mathot <rim@odoo.com>
_pkgbase=r8152
pkgname=${_pkgbase}-dkms
-pkgver=2.08.0
+pkgver=2.10.0
pkgrel=1
pkgdesc="A kernel module for Realtek 8152 network adapters"
url="http://www.realtek.com.tw"
@@ -13,9 +13,9 @@
#!/bin/bash
if [[ "$1" == *.desktop ]]; then
prog=`cat "$1" | grep -e ^Exec | head -n1 | sed 's/^Exec=//' | sed 's/%.//' | sed 's/^"//g' | sed 's/" *$//g'`
firejail $prog
else
filetype=`xdg-mime query filetype "$1"`
defaultapp=`xdg-mime query default "$filetype"`
if [ -f ~/.local/share/applications/"$defaultapp" ]; then
prog=`cat ~/.local/share/applications/"$defaultapp" | grep -e ^Exec | head -n1 | sed 's/^Exec=//' | sed 's/%.//' | sed 's/^"//g' | sed 's/" *$//g'`
@xabbu
xabbu / trivial.patch
Created May 26, 2018 23:28
trivial.patch for Xsane-email-project
diff -ur xsane-0.999/src/xsane-email-project.c xsane-0.999-new/src/xsane-email-project.c
--- xsane-0.999/src/xsane-email-project.c 2010-11-16 21:55:04.000000000 +0100
+++ xsane-0.999-new/src/xsane-email-project.c 2018-05-27 01:15:40.796141322 +0200
@@ -1777,7 +1777,7 @@
for (i=0; i<strlen(password); i++)
{
- password[i] ^= 0x53;
+ password[i] ^= 0xa3;
}
--- xsane/PKGBUILD 2017-11-15 15:11:34.000000000 +0100
+++ xsane-new/PKGBUILD 2018-05-27 12:20:22.679401128 +0200
@@ -11,15 +11,19 @@
license=('GPL2')
makedepends=('gtk2' 'lcms' 'sane' 'zlib' 'libjpeg' 'gimp')
source=(http://www.xsane.org/download/$pkgname-$pkgver.tar.gz
- xsane-0.995-xdg-open.patch)
+ xsane-0.995-xdg-open.patch
+ trivial.patch)
md5sums=('9927f21e1ab6ba96315e7f0e30746deb'