Skip to content

Instantly share code, notes, and snippets.

@intika
intika / bazaar-to-git.md
Last active February 13, 2020 04:37 — forked from josejuansanchez/bazaar-to-git.md
How to import the p2psp bazaar repository in GitHub
@intika
intika / SendRawEth.c
Last active June 5, 2019 01:14 — forked from austinmarton/sendRawEth.c
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* gcc -o sendRaw -O2 SendRawEth.c
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
@Nagi5Yeq
Nagi5Yeq / nginx-tls1.3-openssl.patch
Created November 30, 2018 04:01
A patch to nginx allows you to change TLS 1.3 cipher suites
You can specify a perfered TLS 1.3 cipher suites list in Nginx by the following setting:
ssl_ciphers TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256|ECDHE+AESGCM:HIGH:!aNULL:!eNULL:!MD5;
The TLS 1.3 and TLS 1.2- cipher suites are separated by a '|', notice that you neet to list the full name of TLS 1.3 cipher suites according to OpenSSL Wiki.
Only tested on nginx/1.15.7 with OpenSSL 1.1.1a.
See https://x-nagi.com/2018/11/nginx-tls1-3-patch.html for details.
---
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index a281fba..7e2809b 100644
@Atavic
Atavic / trrprefs.md
Created November 18, 2018 13:08 — forked from bagder/trrprefs.md
trr prefs

NOTE

A blog post with more updated info then this has been posted here

Preferences

All preferences for the DNS-over-HTTPS functionality in Firefox are located under the "network.trr" prefix (TRR == Trusted Recursive Resolver). The support for these are targeted for shipping in release Firefox 62.

network.trr.mode

set which resolver mode you want.

### Flatpak Repos
List packages on a repo :
flatpak remote-ls repon-name --user
flatpak remote-ls
Install packages :
flatpak --user install repo-name package-name io.liri.Platform
Flathub:
@AlexandreBonneau
AlexandreBonneau / combinedview.html
Created March 22, 2018 21:28
Akregator color workaround on dark breeze theme (see https://bugs.kde.org/show_bug.cgi?id=383404)
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>
<title>.</title>
<style type="text/css">
@media screen, print {
body {
font-family: {{ standardFamilyFont }} ! important;
font-size: {{ mediumFontSize}}px ! important;
color: white ! important;
@aleybe
aleybe / savethis.py
Last active April 26, 2020 20:10
Spotify API QuickSave
import json
import urllib.request as urx
import sys
import keyboard
# rl -X PUT "https://api.spotify.com/v1/me/tracks?ids=ssadasdasd" -H "Accept: application/json"
globalauth = "Bearer TOKEN"
isquit = False
@staaldraad
staaldraad / awk_netstat.sh
Last active April 3, 2024 07:01
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Gawk version
# Remote
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
# Local
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}'
# No Gawk
# Local
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
@AtulKsol
AtulKsol / psql-error-fix.md
Last active April 10, 2024 07:41
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)

psql: FATAL: Peer authentication failed for user “postgres” (or any user)

The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).

If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.

But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:

from

@jniltinho
jniltinho / install_php71_opensuse.sh
Last active July 30, 2021 08:10
Install PHP 7.1 on OpenSUSE
#!/bin/bash
### Install PHP 7.1 on OPenSUSE 42.2 64Bits
### https://build.opensuse.org/package/view_file/devel:languages:php/php7/php7.spec?expand=1
### https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
### http://www.shaunfreeman.name/compiling-php-7-on-centos/
zypper in openssl-devel
zypper in gcc gcc-c++ libxml2-devel pkgconfig libbz2-devel curl-devel libwebp-devel