Skip to content

Instantly share code, notes, and snippets.

View FossPrime's full-sized avatar
💭
GitLab rocks!

Ray Foss FossPrime

💭
GitLab rocks!
View GitHub Profile
@rafaelsq
rafaelsq / index.html
Last active June 10, 2024 07:20
TOTP with Web Crypto API
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
<title>TOTP</title>
</head>
<body>
<section class="section">
@juniorcesarabreu
juniorcesarabreu / How to Install Older version of Chrome Extensions.md
Last active July 17, 2024 10:06
How to Install Older version of Chrome Extensions
@timneutkens
timneutkens / index.js
Last active March 4, 2024 14:01
Clear console/terminal in node.js the right way
const readline = require('readline')
const blank = '\n'.repeat(process.stdout.rows)
console.log(blank)
readline.cursorTo(process.stdout, 0, 0)
readline.clearScreenDown(process.stdout)
@brandt
brandt / README.md
Last active February 3, 2024 01:28
Creates a loopback alias with IP 127.0.0.2 at startup on Mac OS X

Loopback Alias

Creates an alias on the loopback interface (lo0) with the IP 127.0.0.2 on macOS.

Installation

  1. Install the plist to: /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  2. Set mode: sudo chmod 0644 /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  3. Set owner: sudo chown root:wheel /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
  4. Load: sudo launchctl load /Library/LaunchDaemons/com.runlevel1.lo0.127.0.0.2.plist
@funzoneq
funzoneq / simplehttp.service
Created May 25, 2016 13:24
A systemd file for a python SimpleHTTPServer
[Unit]
Description=Job that runs the python SimpleHTTPServer daemon
Documentation=man:SimpleHTTPServer(1)
[Service]
Type=simple
WorkingDirectory=/tmp/letsencrypt
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'`
'use strict';
module.exports = function(app) {
return function(req, res, next) {
app.service('things').Model.aggregate([{
$match: {}
}, {
$project: {
year: {
$year: '$createdAt'
@dcondrey
dcondrey / ffmpegchapters-explicit.sh
Created April 20, 2016 08:34
Use ffmpeg to split file by chapters. Python version and bash version
#!/bin/bash
# Author: http://crunchbang.org/forums/viewtopic.php?id=38748#p414992
# m4bronto
# Chapter #0:0: start 0.000000, end 1290.013333
# first _ _ start _ end
while [ $# -gt 0 ]; do
ffmpeg -i "$1" 2> tmp.txt
@Enegnei
Enegnei / HTTPShame.md
Last active May 12, 2024 10:28
A shame-list of popular websites which have not yet deployed HTTPS certificates

HTTPS vs HTTP

HTTPShame

A shame-list of popular or important websites which have not yet deployed HTTPS certificates by default.

Sites which may involve the transmission of very sensitive data, such as health or banking information, are marked with an ❗ to signal they should deploy HTTPS-by-default as soon as possible. If you are a popular website (such as those on the Alexa Top 500 Global Sites) which finds itself on this list - and you want to be removed - you can visit Let's Encrypt about transitioning to HTTPS. It's easy, free, and will help you learn how to protect your customers/ readers!

List now outdated, removed until further notice.

Q: What is HTTPS?

@mrkpatchaa
mrkpatchaa / README.md
Last active June 6, 2024 21:03
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active July 18, 2024 07:33
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target