Skip to content

Instantly share code, notes, and snippets.

View rhaseven7h's full-sized avatar
🙊

Gabriel Medina rhaseven7h

🙊
View GitHub Profile
@aliang
aliang / Mac SSH Autocomplete
Created June 14, 2011 07:14
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@jadonk
jadonk / epolltest.c
Created May 3, 2012 17:41
Quick test using epoll to wait on GPIO events
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/epoll.h>
#include <sys/types.h>
int main(int argc, char** argv) {
@trcarden
trcarden / gist:3295935
Created August 8, 2012 15:28
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@thomasfr
thomasfr / warmly.sh
Last active October 12, 2023 06:17
A wget based easy poor man`s cache warmer script
#!/bin/bash
# warmly.sh
# A wget based, easy, poor man`s cache warmer script
# https://gist.github.com/thomasfr/7926314
# The MIT License (MIT)
#
# Copyright (c) 2013,2014 Thomas Fritz <fritztho@gmail.com> (http://fritzthomas.com)
#
@rhaseven7h
rhaseven7h / more_than_1k.js
Created January 23, 2014 06:00
This is a generic way of fetching more than 1000 rows from a search in NetSuite.
console.clear();
var res;
var rows = new Array();
res = nlapiSearchRecord("customrecord_tel_tarifas_globales", null, null, null);
if(res) {
rows = rows.concat(res);
@elithrar
elithrar / supervisord.conf
Last active September 4, 2021 20:08
Example supervisord.conf for a Go application #golang
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0770
chown=root:supervisor
[supervisord]
pidfile=/var/run/supervisord.pid
nodaemon=false
logfile=/var/log/supervisord/supervisord.log
loglevel=error
@fiorix
fiorix / gist:9664255
Created March 20, 2014 13:55
Go multicast example
package main
import (
"encoding/hex"
"log"
"net"
"time"
)
const (
@rhaseven7h
rhaseven7h / Main.java
Created June 10, 2016 20:59
Get single character in java console (terminal, blocking call)
import java.io.Console;
import java.io.IOException;
import java.io.Reader;
import java.lang.Runtime;
public class Main {
public static void main(String[] args) throws IOException, InterruptedException {
System.out.println("Press the \"z\" key to exit!");
String[] cmd = {"/bin/sh", "-c", "stty raw </dev/tty"};
@vbsessa
vbsessa / chrome-devtools.md
Last active May 2, 2024 23:25
How to customize Chrome devtools fonts
  1. Enable #enable-devtools-experiments flag in chrome://flags section.

  2. Open Chorme Devtools and check Settings > Experiments > Allow extensions to load custom stylesheets.

  3. Create the following four files in a dedicated folder.

    3.1. devtools.html

    <html>
    <head></head>
    <body><script src="devtools.js"></script></body>
## Useful Commands
Get kubectl version
kubectl version
Get cluster info: