Skip to content

Instantly share code, notes, and snippets.

View lxe's full-sized avatar
🌮
Taco

Aleksey Smolenchuk lxe

🌮
Taco
View GitHub Profile
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@johanmeiring
johanmeiring / gist:3002458
Created June 27, 2012 08:32
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@turtlesoupy
turtlesoupy / nginx.conf
Created July 8, 2012 21:16
node.js upstream nginx config
http {
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 6;
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mikeal
mikeal / gist:9242748
Last active June 23, 2020 05:17
Response to Nodejitsu NPM Trademark

I've known people at nodejitsu for years, since before the company even existed. I still consider many of them friends. That said, somebody over there has lost their mind.

Trademarks are an important part of open source. They protect the integrity of the trust that is built by any project. A classic example of why this is the case is Firefox. Suppose that a malware producer takes the Firefox codebase, which is free and open source, packages up their malware with it and then releases it as "Firefox". Then they buy search advertising and suddenly their bad and malicious version of Firefox is the first result on search engines across the web. This is clearly a bad thing for Firefox and open source everywhere, but what can Mozilla do to protect their community of users?

They can't enforce a software license since the use is permitted under the Mozilla Public License. They can, however, enforce on these hypothetical bad actors using their trademark on the word "Fi

@vicapow
vicapow / .bash_profile
Created March 24, 2014 18:53
a small .bash_profile snippet to force renew a new local ip from a DHCP server
random-mac()
{
node -e "var v = [1,2,3,4,5,6,7,8,9,0,'a','b','c','d','e','f']; var r = function(){ return v[Math.floor(Math.random() * v.length)] }; console.log( '00:' + r() + r() + ':' + r() + r() + ':' + r() + r() + ':' + r() + r() + ':' + r() + r())"
}
new-ip()
{
sudo ifconfig en0 ether `random-mac`
sudo ipconfig set en0 BOOTP
sudo ipconfig set en0 DHCP
@takeshixx
takeshixx / hb-test.py
Last active November 6, 2024 06:58
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <[email protected]>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford ([email protected]).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@lhecker
lhecker / bytesum_intrinsics.c
Created May 13, 2014 15:14
Optimized version of bytesum_intrinsics.c from http://jvns.ca/blog/2014/05/12/computers-are-fast/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
#include <emmintrin.h>
/*
* Round up n to the next multiple of m.
* m needs to be a power of 2.
*/
@ecto
ecto / maybe_exit.sh
Last active September 15, 2016 17:51
~ :q 10:50 AM
Your shell has no parents. Are you sure you want to exit? (y/n)n
@lxe
lxe / goes16-rtlsdr.md
Last active November 14, 2024 16:14
Receive GOES-16 and GOES-17 Images with a Raspberry Pi and RTL-SDR dongle