Skip to content

Instantly share code, notes, and snippets.

View rhaseven7h's full-sized avatar
🙊

Gabriel Medina rhaseven7h

🙊
View GitHub Profile
@rhaseven7h
rhaseven7h / centos-install-syntax-highlighting-in-less.sh
Created May 7, 2020 08:17 — forked from textarcana/centos-install-syntax-highlighting-in-less.sh
2020 update: just use bat(1) instead!!!! bat has git integration and also can show invisible characters! OLD STUFF: How to enable syntax-highlighting in less. Use `less -N` (or type -N while in less) to enable line numbers. Based on the procedure described in http://superuser.com/questions/71588
# Enable syntax-highlighting in less.
# Last tested on CentOS 6.3.
#
# First, add these two lines to ~/.bashrc
# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
# export LESS=" -R "
sudo yum -y install boost boost-devel ctags
wget http://springdale.math.ias.edu/data/puias/unsupported/6/x86_64/source-highlight-3.1.6-3.puias6.x86_64.rpm
@rhaseven7h
rhaseven7h / chrome-devtools.md
Created April 30, 2020 19:19 — forked from vbsessa/chrome-devtools.md
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 custom UI themes.

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

    3.1. devtools.html

    <html>
    <head></head>
    <body><script src="devtools.js"></script></body>
@rhaseven7h
rhaseven7h / main.go
Created July 3, 2019 02:08
Sentry Raven Go (Golang) Usage, along with custom Type and Value (Exception Title and Message)
package main
import (
"fmt"
"os"
"time"
"github.com/brianvoe/gofakeit"
"github.com/getsentry/raven-go"
"github.com/pkg/errors"
@rhaseven7h
rhaseven7h / README.md
Created July 1, 2019 03:47 — forked from denji/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@rhaseven7h
rhaseven7h / get-certificate.sh
Last active June 12, 2019 20:52
Let's Encrypt - Ubuntu 18.04 - CertBot Wildcard Certificate
#!/bin/sh
certbot certonly \
--manual \
-d '*.yourdomain.com' \
-d yourdomain.com \
--agree-tos \
--no-bootstrap \
--manual-public-ip-logging-ok \
--preferred-challenges dns-01 \
@rhaseven7h
rhaseven7h / .tmux.conf
Created May 27, 2019 04:30
Sample Tmux Config
unbind-key C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split commands
unbind-key '%'
unbind-key '"'
bind-key '/' split-window -h
bind-key '-' split-window -v
@rhaseven7h
rhaseven7h / supervisord.conf
Created April 5, 2019 03:35 — forked from elithrar/supervisord.conf
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
@rhaseven7h
rhaseven7h / gist:8ef191143e086652dec5057fe3a79d74
Created December 23, 2018 10:07 — forked from fiorix/gist:9664255
Go multicast example
package main
import (
"encoding/hex"
"log"
"net"
"time"
)
const (
@rhaseven7h
rhaseven7h / AlernateFallbackSocketCreation.java
Last active August 12, 2018 10:07
AyncTask for Bluetooth on Android
class SomeClass {
public void SomeMethod() {
Class<?> clazz = bluetoothSocket.getRemoteDevice().getClass();
Class<?>[] paramTypes = new Class<?>[]{Integer.TYPE};
@SuppressWarnings("JavaReflectionMemberAccess")
Method m = clazz.getMethod("createRfcommSocket", paramTypes);
Object[] params = new Object[]{1};
bluetoothSocket = (BluetoothSocket) m.invoke(bluetoothSocket.getRemoteDevice(), params);
}
}
@rhaseven7h
rhaseven7h / WiFiLampController.ino
Created July 19, 2018 07:14
Arduino WiFi Lamp Controller
#include <SerialESP8266wifi.h>
#define PIN_WIFI_RESET 8
#define PIN_RELAY_SIGNAL 9
SerialESP8266wifi wifi(Serial1, Serial1, PIN_WIFI_RESET, Serial);
char vBuff[64] = "";
String ipAddress = "0.0.0.0";