Skip to content

Instantly share code, notes, and snippets.

View snehesht's full-sized avatar

Snehesh snehesht

View GitHub Profile
@giannitedesco
giannitedesco / gash.py
Created August 30, 2018 08:13
Send secret messages to someone using their public ssh key
#!/usr/bin/python3
__copyright__ = "Copyright (c) 2018 Gianni Tedesco"
__licence__ = "GPLv3"
__doc__ = "Tool for sending secret messages using ssh keys"
from argparse import ArgumentParser
try:
import nacl.utils
from nacl.signing import SigningKey,VerifyKey
### Localization
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
### Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string example.org
d-i netcfg/wireless_wep string
@niklasvincent
niklasvincent / build-nginx.sh
Last active October 11, 2019 04:44
Build script for statically compiled nginx 1.4.7 with OpenSSL 1.0.1e.
#!/bin/bash
set -e
NGINX_VERSION="1.6.0"
NGINX_TARBALL="nginx-${NGINX_VERSION}.tar.gz"
PCRE_VERSION="8.34"
PCRE_TARBALL="pcre-${PCRE_VERSION}.tar.gz"
OPENSSL_VERSION="1.0.1g"
OPENSSL_TARBALL="openssl-${OPENSSL_VERSION}.tar.gz"
@jult
jult / TLS
Last active December 7, 2020 00:10
My nginx include for TLS A+ rating at ssllabs.com/ssltest using nginx/1.14.* and openssl 1.1.1*
# version 2020 feb 24
ssl_certificate /etc/letsencrypt/live/yardomain.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yardomain.org/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/yardomain.org/chain.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
@kiok46
kiok46 / redux_setup.md
Last active February 15, 2021 01:02
Redux, store, actions and reducers setup along with explanation.

Redux Setup

Implementation of redux inside any react.js or react-native application,

  • we will create an instance of the redux store.
  • We are going to create a provider tag from react redux library
  • Then render that provider tag passing in the store as a prop, then any child component to this provider tag will have access to this store through the context system inside of react.
  • import { Provider } from ‘react-redux’; // In main.js
  • to create a store create one in a separate folder.
@ollyg
ollyg / logstash.conf
Created June 20, 2012 13:29
logstash config and filter to fully parse a syslog message (PRI, timestamp, host)
filter {
# strip the syslog PRI part and create facility and severity fields.
# the original syslog message is saved in field %{syslog_raw_message}.
# the extracted PRI is available in the %{syslog_pri} field.
#
# You get %{syslog_facility_code} and %{syslog_severity_code} fields.
# You also get %{syslog_facility} and %{syslog_severity} fields if the
# use_labels option is set True (the default) on syslog_pri filter.
grok {
type => "syslog-relay"
@Tukki
Tukki / gist:3953990
Created October 25, 2012 16:52
filter by time in sqlalchemy
#http://stackoverflow.com/questions/7075828/make-sqlalchemy-use-date-in-filter-using-postgresql
from sqlalchemy import Date, cast
from datetime import date
my_date = (session.query(MyObject)
.filter(cast(MyObject.date_time, Date) == date.today())
.all())
@Brainiarc7
Brainiarc7 / gstreamer-module-build-cluster.md
Last active June 23, 2021 23:46
Guide: How to build gstreamer from source on Ubuntu 16.04 for loading via the modules system

Build gstreamer from source (git checkouts):

Install build dependencies:

sudo apt-get install gtk-doc-tools liborc-0.4-0 liborc-0.4-dev libvorbis-dev libcdparanoia-dev libcdparanoia0 cdparanoia libvisual-0.4-0 libvisual-0.4-dev libvisual-0.4-plugins libvisual-projectm vorbis-tools vorbisgain libopus-dev libopus-doc libopus0 libopusfile-dev libopusfile0 libtheora-bin libtheora-dev libtheora-doc libvpx-dev libvpx-doc libvpx3 libqt5gstreamer-1.0-0 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libflac++-dev libavc1394-dev libraw1394-dev libraw1394-tools libraw1394-doc libraw1394-tools libtag1-dev libtagc0-dev libwavpack-dev wavpack

Extras:

@MineRobber9000
MineRobber9000 / 2fa
Created April 3, 2020 03:45
2-factor authentication terminal app in Python
#!/usr/bin/env python
import os, os.path, stat, sys, base64
# TOTP lib inlined
import time, hmac, base64, hashlib, struct
def pack_counter(t):
return struct.pack(">Q", t)
bindkey "[D" backward-word
bindkey "[C" forward-word
export PATH=/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/hugosequeira/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/