Skip to content

Instantly share code, notes, and snippets.

View sahwar's full-sized avatar
💭
https://twitter.com/ve4ernik

sahwar

💭
https://twitter.com/ve4ernik
View GitHub Profile
@sahwar
sahwar / slice.py
Created April 19, 2022 09:17 — forked from ny0m/slice.py
A python class to split a word into separate units, split into syllables, called morphemes. Part of a portmanteau generator I built.
class Slice(object):
def __init__(self, root, leng):
self.root = root # The original word
self.leng = leng # How many morphemes should be used as the prefix for the new portmanteau
self.morphemes = []
self.output = '' #
self.slice()
def slice(self):
import re
@sahwar
sahwar / app.DockerFile
Created April 11, 2022 12:03 — forked from satendra02/app.DockerFile
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
@sahwar
sahwar / tls_guide.md
Created April 11, 2022 12:03 — forked from InternalLoss/tls_guide.md
3DS/WiiU TLS traffic guide

Dumping Nintendo TLS Traffic

This guide is for capturing encrypted web traffic between the Internet and a 3DS or Wii U. You will need a hacked console for this.

NOTE: This traffic is sensitive - it will likely contain sensitive data such as a hashed form of your NNID password, and the device's unique identifiers including their unique certificates - as such, please be careful who you share these dumps with! They should be stored safely.

TLS Traffic

Dumping TLS traffic requires a proxy - we suggest mitmproxy which is both FOSS and cross-platform. It also has a web view which is useful for saving the recorded data (though this can also be done via CLI, as explained later).

@sahwar
sahwar / TranslateToChineseOnYouTube.user.js
Created April 11, 2022 12:03 — forked from qwertyuiop6/TranslateToChineseOnYouTube.user.js
Translate to Chinese automatically. youtube自动翻译中文简体
// ==UserScript==
// @name YouTube字幕自动选择翻译->中文简体
// @namespace http://tampermonkey.net/
// @version 1.2
// @description translate to Chinese automatically. 自动点击字幕翻译到中文简体
// @author qwertyuiop6
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@sahwar
sahwar / protos-openwebinars.js
Created April 11, 2022 12:02 — forked from nidstang/protos-openwebinars.js
JavaScript prototypes playground for openwebinars
const objs = [
{ a: 'a', b: 'ab' },
{ b: 'b' },
{ c: 'c', b: 'cb' },
];
// aggregation
const collection = (a, e) => a.concat([e]);
@sahwar
sahwar / linux-server-setup.md
Created April 11, 2022 12:02 — forked from itsabdelrahman/linux-server-setup.md
Linux Ubuntu/Debian Server Setup

Linux Ubuntu/Debian Server Setup

On remote machine

As root

  1. Change root password
    • $ passwd
  2. Create user & their home directory
  • $ useradd -m
@sahwar
sahwar / linkedin_connections.js
Created April 11, 2022 12:02 — forked from zohar-p/linkedin_connections.js
Dead simple Linkedin automatic connection request sender
/**
* Go to https://www.linkedin.com/mynetwork/
* Click the `see all` button next to "<OCCUPATION_NAME> you may know"
* Paste the code snippet below in the console
* Change the `requestsLimit` and `occupationKeywords` according to your needs
* Run the code
*/
(() => {
// Change to the desired number (Linkedin limits you to 80 a day)
@sahwar
sahwar / s1_script
Created April 11, 2022 12:02 — forked from zxc111/s1_script
s1挂机脚本
# -*- encoding: utf8 -*-
import urllib2
import urllib
from cookielib import CookieJar
import pdb
import time
def check_process():
import subprocess
import sys
@sahwar
sahwar / curl.md
Created April 11, 2022 12:02 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@sahwar
sahwar / async await in chrome extension
Created April 11, 2022 12:01 — forked from BigSully/async await in chrome extension
async await in chrome extension
/**
* Usage:
* let cookies = await asyncfy(chrome.cookies.getAll)({ url })
* let tabs = await asyncfy(chrome.tabs.query)({active: true, currentWindow: true})
*
* @param fn A function that takes one or more parameters, and the last parameter is a callback which has one or more parameter. The simplest one is chrome.management.getSelf
* @returns {function(...[*]): Promise<any>} Return one value if the results array has only one element, else return the whole results array
*/
let asyncfy = fn => (...args) => {
return new Promise((resolve, reject) => {