Skip to content

Instantly share code, notes, and snippets.

View Stwissel's full-sized avatar
💭
I may be slow to respond.

Stephan H. Wissel Stwissel

💭
I may be slow to respond.
View GitHub Profile
@tbranyen
tbranyen / couchdb-importer.js
Created May 16, 2012 19:45
Miso Project - Dataset: CouchDB Importer
// Underscore utility
var _ = require("underscore");
// Miso library
var Miso = require("miso.dataset");
// Nano library
var nano = require("nano");
/*
* The Couchdb importer is responsible for fetching data from a CouchDB
* database.
@tbranyen
tbranyen / couchdb-parser.js
Created May 16, 2012 19:46
Miso Project - Dataset: CouchDB Parser
// Underscore utility
var _ = require("underscore");
// Miso library
var Miso = require("miso.dataset");
Miso.Parsers.Couchdb = function(data, options) {};
_.extend(Miso.Parsers.Couchdb.prototype, {
parse: function(rows) {
var columns, valueIsObject;
@NapoleonWils0n
NapoleonWils0n / opensll_encrypt_files.sh
Created November 2, 2012 02:27
bash: openssl encrypt files
# Generate private and public keys with password.
openssl req -x509 -days 100000 -newkey rsa:2048 -keyout privatekey.pem -out publickey.pem -subj "/"
# Generate private and public keys without password. (add -nodes to the command)
openssl req -x509 -nodes -days 100000 -newkey rsa:2048 -keyout privatekey.pem -out publickey.pem -subj "/"
# Encrypt seemingly endless amount of data.
openssl smime -encrypt -aes256 -in LargeFile.zip -binary -outform DEM -out LargeFile_encrypted.zip publickey.pem
# Decrypt
@corbanb
corbanb / pre-request-jwt.js
Last active July 22, 2024 13:12
JWT tokenize - Postman Pre-Request Script
function base64url(source) {
// Encode in classical base64
encodedSource = CryptoJS.enc.Base64.stringify(source);
// Remove padding equal characters
encodedSource = encodedSource.replace(/=+$/, '');
// Replace characters according to base64url specifications
encodedSource = encodedSource.replace(/\+/g, '-');
encodedSource = encodedSource.replace(/\//g, '_');
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active January 23, 2025 16:11
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@superbob
superbob / ddns_provider.conf
Last active February 23, 2025 13:44
Namecheap Synology DSM DDNS provider
#Insert this at the end of /etc.defaults/ddns_provider.conf
[Namecheap]
modulepath=/usr/syno/bin/ddns/namecheap.php
queryurl=https://dynamicdns.park-your-domain.com/update
@RickyCook
RickyCook / _notes.md
Last active September 25, 2024 03:14
Quick bastion Wireguard VPN

Quick and dirty Wireguard bastion VPN

Enable IPv4 forwarding

sysctl -w net.ipv4.ip_forward=1 or echo 1 > /proc/sys/net/ipv4/ip_forward

/etc/sysctl.conf: net.ipv4.ip_forward = 1

Check IPv4 forwarding

const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
let widget = await createWidget()
widget.backgroundColor = new Color("#777777")
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
Script.complete()
@jorcelinojunior
jorcelinojunior / cursor_appimage_manager.sh
Last active April 17, 2025 05:02
Automate the integration of Cursor .AppImage on Linux: updates .desktop, manages icons, ensures the latest version, and configures AppArmor (Required for Ubuntu 24.04).
#!/bin/bash
set -euo pipefail
# Definition of colors for terminal output
readonly RED_COLOR="\e[31m"
readonly GREEN_COLOR="\e[32m"
readonly YELLOW_COLOR="\e[33m"
readonly BLUE_COLOR="\e[34m"
readonly MAGENTA_COLOR="\e[35m"