Skip to content

Instantly share code, notes, and snippets.

@intika
intika / savethis.py
Created Apr 26, 2020 — forked from aleybe/savethis.py
Spotify API QuickSave
View savethis.py
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 Apr 26, 2020 — 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.
View sp
#!/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 Apr 20, 2020 — forked from Nagi5Yeq/nginx-tls1.3-openssl.patch
A patch to nginx allows you to change TLS 1.3 cipher suites
View nginx-tls1.3-openssl.patch
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 Feb 13, 2020 — forked from josejuansanchez/bazaar-to-git.md
How to import the p2psp bazaar repository in GitHub
View bazaar-to-git.md
@intika
intika / Android-Dev-Env-Linux
Created Feb 5, 2020 — forked from venkateshshukla/AndroidDevLinux
Setting up your Linux for Android Application Development
View Android-Dev-Env-Linux
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
View prosody.cfg.lua
-- 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 Dec 1, 2019 — forked from AtulKsol/psql-error-fix.md
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)
View psql-error-fix.md

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 Jun 6, 2019 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams
View Netfilter-IPTables-Diagrams.md

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 Jun 5, 2019 — forked from austinmarton/sendRawEth.c
Send a raw Ethernet frame in Linux
View SendRawEth.c
/*
* 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>
@intika
intika / ipvlan_l3_mode_example.md
Created May 4, 2019 — forked from nerdalert/ipvlan_l3_mode_example.md
IPVlan L3 Mode Two Host Example
View ipvlan_l3_mode_example.md

Quick Paste Ipvlan L3 Instructions

  • Host #1
ip netns add ns1
ip link add link eth1 ipvl1 type ipvlan mode l3
ip link set dev ipvl1 netns ns1

ip netns exec ns1 bash