Skip to content

Instantly share code, notes, and snippets.

View lidopaglia's full-sized avatar

Lido Paglia lidopaglia

View GitHub Profile
@lidopaglia
lidopaglia / karabiner_launch_apps.json
Created April 19, 2020 17:48
example rule for opening iTerm2 with command+shift+t with Karabiner Elements
# https://karabiner-elements.pqrs.org/docs/json/location/
{
"title": "Launch apps",
"rules": [
{
"description": "Launch iTerm with command + shift + t",
"manipulators": [
{
"from": {
@lidopaglia
lidopaglia / dot-install.sh
Created May 23, 2020 15:27
Install dotfiles on an existing system
!#/bin/sh
git clone --bare [email protected]:lidopaglia/dotfiles.git $HOME/.dotfiles
function dot {
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
mkdir -p .dotfiles-backup
dot checkout
@lidopaglia
lidopaglia / gist:706fb580b11ce1281b217199c915d932
Created March 10, 2021 15:07 — forked from alexandernl/gist:8090a79a7af4197c5f5571e8cc8c05b8
Convert daily New York Times frontpage to jpg
<?php
// set the output-file
$outputfile = "/var/www/nyt/nyt.jpg";
// set path to todays NYT frontpage
$pathToPdf="https://static01.nyt.com/images/".date('Y')."/".date('m')."/".date('d')."/nytfrontpage/scan.pdf";
// check if there is any today
$file_headers = @get_headers($pathToPdf);
# Gnome Terminal Gruvbox
#
# Import/Export Gnome Terminal profile(s) with:
#
# dconf dump /org/gnome/terminal/legacy/profiles:/:a49b6940-a9ef-4922-b874-574cad1da151/ > ~/Downloads/gruvbox.dconf
# dconf load /org/gnome/terminal/legacy/profiles:/:a49b6940-a9ef-4922-b874-574cad1da151/ < ~/Downloads/gruvbox.dconf
#
# https://gist.github.com/reavon/0bbe99150810baa5623e5f601aa93afc
[/]
@lidopaglia
lidopaglia / rhysider-books.md
Last active March 12, 2022 19:32
Jack Rhysider's Favorite Books

Jack Rhysider's Favorite Books

jack rhysider

Jack Rhysider, creator of the [Darknet Diaries][10] podcast, was recently interviewed on [Paul's Security Weekly Podcast #702][6] and the following books are [highlighted in the interview][8] as some of Jack's favorite.

  1. [Countdown to Zero Day: Stuxnet and the Launch of the World's First Digital Weapon][1] by Kim Zetter
@lidopaglia
lidopaglia / curl.md
Created August 7, 2021 15:31 — 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.

@lidopaglia
lidopaglia / python_ldaps.py
Created August 7, 2021 15:47
python-ldaps
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import sys
import getpass
import ldap
def getLdapUsers():
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
l = ldap.initialize('ldaps://ldap.example.com')
@lidopaglia
lidopaglia / nginx-ip-api.md
Created August 7, 2021 15:56
NGINX script for making your own public IP API

NGINX script for making your own public IP API

location /ip {
    default_type text/plain;
    return 200 $remote_addr;
}
location /ip_json {
    default_type application/json;
 return 200 "{\"ip\":\"$remote_addr\"}";
@lidopaglia
lidopaglia / 01.bash_shortcuts_v2.md
Created August 7, 2021 16:00 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line