Skip to content

Instantly share code, notes, and snippets.

@probonopd
probonopd / Wayland.md
Last active May 6, 2024 23:49
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@rfairley
rfairley / reverse-ssh-tunnel-vps-to-pi.md
Last active February 15, 2024 09:23
Connecting to a Raspberry Pi through a VPS using a reverse SSH tunnel

Connecting to a Raspberry Pi through a VPS using a reverse SSH tunnel

SSH (Secure Shell) to a host existing in an internal network through a reverse-tunneled SSH connection to an externally accessible VPS (Virtual Private Server). This setup is described where the internal host is a Raspberry Pi, but can be generalized for any host on the internal network that runs an OpenSSH server.

  internal network                                                   Internet                                       home network
                                              ||                                                         ||
 ------------------                           ||                          ------------------             ||             ------------------
|                  | reverse SSH tunnel (VPS $tunnel_port to Pi port 22) |                  |            ||            |                  |
|   Raspberry Pi     ==================================================>         VPS          ===================
@unoexperto
unoexperto / patch_apk_for_sniffing.md
Last active May 6, 2024 15:19
How to patch Android app to sniff its HTTPS traffic with self-signed certificate

How to patch Android app to sniff its HTTPS traffic with self-signed certificate

  • Download apktool from https://ibotpeaches.github.io/Apktool/
  • Unpack apk file: java -jar /home/expert/work/tools/apktool.jar d net.flixster.android-9.1.3@APK4Fun.com.apk
  • Modify AndroidManifest.xml by adding android:networkSecurityConfig="@xml/network_security_config" attribute to application element.
  • Create file /res/xml/network_security_config.xml with following content:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config>
@comm1x
comm1x / docker_dns_workaround.md
Last active October 22, 2018 15:53
Docker DNS workaround

Docker DNS workaround

1. Run docker container, which will resolve inner containers

version: '2'
services:
  dns-gen:
    container_name: dns-gen 
    image: jderusse/dns-gen

ports:

@anvk
anvk / psql_useful_stat_queries.sql
Last active April 23, 2024 03:15
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@ketanghumatkar
ketanghumatkar / wkhtmltopdf.sh
Created October 5, 2015 13:51
Installing wkhtmltopdf on ubuntu
apt-get install wkhtmltopdf
apt-get install xvfb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
chmod a+rx /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/bin/wkhtmltopdf
wkhtmltopdf http://www.google.com output.pdf
@kwn
kwn / xdebug.ini
Last active November 11, 2021 10:18
Xdebug config with autostart
zend_extension=xdebug.so
xdebug.default_enable = 1
xdebug.cli_color = 1
xdebug.overload_var_dump = 1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = 4096
xdebug.var_display_max_depth = 10
xdebug.max_nesting_level = 250
xdebug.remote_enable = 1
fix for hotkeys not functional in non-latin keyboard layout in 13.10 / 14.04
tested on ubuntu 14.04, jvm7 and rubymine 6.3
sudo add-apt-repository ppa:attente/java-non-latin-shortcuts
sudo apt-get update
sudo apt-get dist-upgrade
restart unity-settings-daemon
now ctrl+c, ctrl-v etc should work in most java applications like IDEA, RubyMine IDE even on russian keyboard layout
@etheriqa
etheriqa / Worker.php
Last active August 9, 2023 08:40
Parallel processing on PHP using stream_select()
<?php
interface Worker
{
public function getCommand();
public function done($stdout, $stderr);
public function fail($stdout, $stderr, $status);
}