Skip to content

Instantly share code, notes, and snippets.

@intika
intika / MKSH-Logs.patch
Last active August 14, 2021 17:05 — forked from flankerhqd/external.patch
Patch on mksh to enable shell command logging into logcat. Rememeber to replace ash to mksh on emulator builds.
diff --git a/Android.mk b/Android.mk
index e53b863..1d3854e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -8,7 +8,6 @@ LOCAL_PATH:= $(call my-dir)
# /system/etc/mkshrc
include $(CLEAR_VARS)
-
LOCAL_MODULE:= mkshrc
@intika
intika / savethis.py
Created April 26, 2020 20:10 — forked from aleybe/savethis.py
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
@intika
intika / sp
Created April 26, 2020 13:57 — forked from wandernauta/sp
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
#!/usr/bin/env bash
#
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
#
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
#
@intika
intika / nginx-tls1.3-openssl.patch
Created April 20, 2020 11:23 — forked from Nagi5Yeq/nginx-tls1.3-openssl.patch
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
@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 / Android-Dev-Env-Linux
Created February 5, 2020 00:23 — forked from venkateshshukla/AndroidDevLinux
Setting up your Linux for Android Application Development
Step 1. Preparation
--------------------
First take care of the dependencies for Android Application Development.
Dependencies are -
1. Java
2. ant
3. Eclipse and Android Development tools (IDE)
4. Android SDK and NDK
5. adb
@intika
intika / prosody.cfg.lua
Created January 28, 2020 19:37 — forked from flowolf/prosody.cfg.lua
Prosody Config
-- Prosody XMPP Server Configuration
--
-- Information on configuring Prosody can be found on our
-- website at http://prosody.im/doc/configure
--
-- Tip: You can check that the syntax of this file is correct
-- when you have finished by running: luac -p prosody.cfg.lua
-- If there are any errors, it will let you know what and where
-- they are, otherwise it will keep quiet.
--
@intika
intika / psql-error-fix.md
Created December 1, 2019 21:05 — forked from AtulKsol/psql-error-fix.md
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

@intika
intika / Netfilter-IPTables-Diagrams.md
Created June 6, 2019 01:18 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@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>