Skip to content

Instantly share code, notes, and snippets.

@moyix
moyix / ensure_fpu.py
Last active March 5, 2024 10:55
Some handy utils for messing with MXCSR (x86-64 SSE FPU control register)
#!/usr/bin/env python
import sys, os
import platform
import ctypes as ct
import mmap
from enum import Enum
import importlib
import functools
import errno
@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>
@tsl0922
tsl0922 / .tmux.conf
Last active April 30, 2024 10:29
vim style tmux config
# vim style tmux config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
@ah8r
ah8r / README.md
Last active June 7, 2020 19:51
Hut3 Cardiac Arrest (compatible with Python 2.7)

Cardiac Arrest

Hut3 Cardiac Arrest - A script to check OpenSSL servers for the Heartbleed bug (CVE-2014-0160).

Note: This code was originally a GitHub Gist but has been copied to a full GitHub Repository so issues can also be tracked. Both will be kept updated with the latest code revisions.

DISCLAIMER: There have been unconfirmed reports that this script can render HP iLO unresponsive. This script complies with the TLS specification, so responsitivity issues are likely the result of a bad implementation of TLS on the server side. CNS Hut3 and Adrian Hayter do not accept responsibility if this script crashes a server you test it against. USE IT AT YOUR OWN RISK. As always, the correct way to test for the vulnerability is to check the version of OpenSSL installed on the server in question. OpenSSL 1.0.1 through 1.0.1f are vulnerable.

This script has several advantages over similar scripts that have been re

@munificent
munificent / gist:9749671
Last active June 23, 2022 04:04
You appear to be creating a new IDE...
You appear to be advocating a new:
[ ] cloud-hosted [ ] locally installable [ ] web-based [ ] browser-based [ ] language-agnostic
[ ] language-specific IDE. Your IDE will not succeed. Here is why it will not succeed.
You appear to believe that:
[ ] Syntax highlighting is what makes programming difficult
[ ] Garbage collection is free
[ ] Computers have infinite memory
[ ] Nobody really needs:
<head>
<title>Title</title>
<meta charset="utf-8">
<meta name="robots" content="all">
</head>
<body>
{{> nav_header}}
{{> index}}
</body>
// On the client AND the server
Rooms = new Meteor.Collection('rooms');
Messages = new Meteor.Collection('messages');
// On the server
Meteor.publish('chatRoom', function(roomId) {
return Messages.find({ roomId: roomId });
});
// On the client
# Setup dir and repo
mkdir underscore-string
cd underscore-string
git init
# Make some files we'll need
touch README.md package.js smart.json
# Add the submodule and checkout the desired branch
git submodule add git://github.com/epeli/underscore.string.git lib/underscore.string
@blakmatrix
blakmatrix / command line shell
Created July 3, 2012 09:07
Getting Meteor todos up on nodejitsu/jitsu
meteor create --example todos
meteor bundle myapp.tgz
tar xzf myapp.tgz
cd bundle
(create package json with settings below)
jitsu databases create mongo <dbname>
(grab dbstring)
jitsu env set PORT 3000
jitsu env set MONGO_URL <dbstring>
jitsu deploy
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000