Skip to content

Instantly share code, notes, and snippets.

View snehesht's full-sized avatar
🎯
Focusing

Snehesh snehesht

🎯
Focusing
View GitHub Profile
@snehesht
snehesht / encrypt_openssl.txt
Last active April 28, 2017 22:02 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@snehesht
snehesht / openload.js
Created June 25, 2017 23:09 — forked from Tithen-Firion/openload.js
Openload: extract download URL using PhantomJS
// Usage: phantomjs openload.js <video_url>
// if that doesn't work try: phantomjs --ssl-protocol=any openload.js <video_url>
var separator = ' | ';
var page = require('webpage').create(),
system = require('system'),
id, match;
if(system.args.length < 2) {
console.error('No URL provided');
@snehesht
snehesht / new-window
Created November 16, 2017 05:30 — forked from tpikonen/new-window
URxvt perl module to allow opening of a new terminal window with a key combination
#!/usr/bin/env perl
use strict;
use warnings;
use Cwd;
# Opening a new window.
# Fixed version of script from
# http://lists.schmorp.de/pipermail/rxvt-unicode/2012q3/001609.html
# by José Romildo Malaquias <malaquias at gmail.com>

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@snehesht
snehesht / make-rir-delegated-latest.py
Created April 27, 2018 06:28 — forked from holly/make-rir-delegated-latest.py
make afrinic/apnic/arin/ripe/lacnic delegated-latest ipv4 and ipv6 list script
#!/usr/bin/env python
# vim:fileencoding=utf-8
""" [NAME] script or package easy description
[DESCRIPTION] script or package description
"""
from datetime import datetime
from argparse import ArgumentParser
import pprint
@snehesht
snehesht / getMP4Length.js
Created May 17, 2018 19:29 — forked from Elements-/getMP4Length.js
Read the duration of a mp4 file nodejs
var buff = new Buffer(100);
fs.open(file, 'r', function(err, fd) {
fs.read(fd, buff, 0, 100, 0, function(err, bytesRead, buffer) {
var start = buffer.indexOf(new Buffer('mvhd')) + 17;
var timeScale = buffer.readUInt32BE(start, 4);
var duration = buffer.readUInt32BE(start + 4, 4);
var movieLength = Math.floor(duration/timeScale);
console.log('time scale: ' + timeScale);
console.log('duration: ' + duration);
@snehesht
snehesht / fonts.css
Created July 12, 2018 15:35
CSS Fonts Hack
/*
* https://css-tricks.com/snippets/css/font-stacks/
* https://css-tricks.com/snippets/css/system-font-stack/
*/
/* Times New Roman-based stack */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* Modern Georgia-based serif stack */
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif", "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
@snehesht
snehesht / index.js
Created July 17, 2018 15:10
Mock Server
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
// app.use(function (req, res, next) {
// req.rawBody = '';
// req.setEncoding('utf8');
// req.on('data', function (chunk) {
@snehesht
snehesht / ssl-proxies.py
Created August 5, 2018 14:33
SSL Proxies
import re, requests, json;
from html.parser import HTMLParser
class SSLParser(HTMLParser):
def handle_data(self, data):
self.result.append(data)
def setup(self):
self.result = [];