Skip to content

Instantly share code, notes, and snippets.

View naltun's full-sized avatar
🕊️
Free/Libre Software to the rescue

Noah naltun

🕊️
Free/Libre Software to the rescue
  • Centers for Disease Control and Prevention - OCIO Digital Services Office
  • /dev/party
View GitHub Profile
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@nolim1t
nolim1t / socket.c
Created June 10, 2009 03:14
HTTP Request in C using low level write to socket functionality
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@lenards
lenards / greybeard
Last active March 21, 2024 18:04
Greybeard Definition
Greybeard
An aging [unix hacker] type with an impressive [unix beard] that has now turned grey. Originally a young [neckbeard], these [Gandalf] resembling [curmudgeons] are renowned for their knowledge of theoretical computer science, arcane unix and complete inability to use a remotely contemporary computer.
Typically employed in academia, they are a dying breed from an antediluvian age of 8" [floppies], magnetic tape and timeshared computing. Despite having invented multiuser OSes and the internet, Greybeards prefer to live in the past, where they consider [Fortran] to be a high level programming language. Typical Greybeard computers are dated [Sun workstations] or old PCs running a command line only [BSD] variant, Greybeards shun GUIs, unless they're horrible and dated, like CDE or [Amiga] Workbench.
Some, like Edsger Dijkstra do most of their computer science as entirely theoretical exercises on paper and haven't programmed a computer since 1972.
Contacting a gr
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@TylerFisher
TylerFisher / hosting-on-github.md
Last active July 21, 2024 05:51
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
@dwayne
dwayne / ch0.md
Last active August 9, 2020 07:57
My notes from the book "Working with TCP Sockets by Jesse Storimer"

Chapter 0

Network programming is ultimately about sharing and communication.

Audience: Ruby devs on Unix or Unix-like systems.

Uses Ruby 1.9.

Part 1 - Introduction to the primitives of Socket programming

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@soarez
soarez / ca.md
Last active July 24, 2024 12:02
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active July 10, 2024 00:17
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps