Skip to content

Instantly share code, notes, and snippets.

@rg3915
rg3915 / README.md
Last active February 17, 2023 23:38
Python click examples
@csswizardry
csswizardry / README.md
Last active April 2, 2024 20:17
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@rougeth
rougeth / talk_tmux.md
Created March 11, 2016 18:55
talk about tmux
  _____/\\\______________________________________________________
   __/\\\\\\\\\\\____/\\\\\__/\\\\\____/\\\____/\\\__/\\\____/\\\_
    _\////\\\////___/\\\///\\\\\///\\\_\/\\\___\/\\\_\///\\\/\\\/__
     ____\/\\\______\/\\\_\//\\\__\/\\\_\/\\\___\/\\\___\///\\\/____
      ____\/\\\_/\\__\/\\\__\/\\\__\/\\\_\/\\\___\/\\\____/\\\/\\\___
       ____\//\\\\\___\/\\\__\/\\\__\/\\\_\//\\\\\\\\\___/\\\/\///\\\_
        _____\/////____\///___\///___\///___\/////////___\///____\///__
@dabeaz
dabeaz / aecho.py
Last active October 17, 2023 03:26
Live-coded examples from my PyCon Brasil 2015 Keynote
# aecho.py
from socket import *
import asyncio
loop = asyncio.get_event_loop()
async def echo_server(address):
sock = socket(AF_INET, SOCK_STREAM)
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
@Khoulaiz
Khoulaiz / gist:41b387883a208d6e914b
Last active May 3, 2024 15:57
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@onlurking
onlurking / slideshare-dl.py
Last active October 20, 2019 02:33
An Slideshare Presentation Downloader written with Python 3 and Insomnia, now only requires img2pdf and BeautifulSoup.
import argparse
import urllib.request
import os
import img2pdf
from os import walk
from os.path import join
from bs4 import BeautifulSoup
work_dir = os.path.dirname(__file__)
anonymous
anonymous / tmux.conf
Created September 9, 2014 18:35
vim friendly tmux configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
@peczenyj
peczenyj / coligacoes.sh
Last active August 29, 2015 14:05
Script que mostra quantas vezes um partido coliga com outro por estado
#!/bin/bash
#
# Este script vai consultar o json da globo.com e vai mostrar em
# quantos estados o partido X coliga com os outros partidos
#
PARTIDO=${1:?favor informar o partido}
URL=http://estaticog1.globo.com/2014/07/Coligacoes/eleicao.json
echo "Coligações do partido $PARTIDO"
@sh1n0b1
sh1n0b1 / ssltest.py
Created April 8, 2014 07:53
Python Heartbleed (CVE-2014-0160) Proof of Concept
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
#!/bin/bash
# Autor: Nilton OS -- www.linuxpro.com.br
echo 'setup-web2py-nginx-uwsgi-centos64.sh'
echo 'Support CentOS 6.4'
echo 'Installs Nginx 1.4.1 + uWSGI + Web2py'
# Get Web2py Admin Password
echo -e "Web2py Admin Password: \c "
read PW