Skip to content

Instantly share code, notes, and snippets.

View R4wm's full-sized avatar
💝
tab tab tab...

r4wm R4wm

💝
tab tab tab...
View GitHub Profile
@R4wm
R4wm / find_process_by_name.py
Created October 18, 2018 23:53
Simple way of finding process by name without using subprocess
#!/usr/bin/env python
import psutil
l_proc_list = psutil.get_process_list()
for i in l_proc_list:
if i.name == 'waflz_server':
print("FOUND WAFLZ_SERVER")
@R4wm
R4wm / cross_compile_raspberry_pi3.sh
Created November 22, 2018 23:50
corss compile for raspberry pi 3
#!/bin/bash
env GOOS=linux GOARCH=arm64 GOARM=7 go build main.go
@arch-lt ~>
@arch-lt ~>
@arch-lt ~>
@arch-lt ~> curl -svo time /dev/null http://mintz5.com --doh-url https://faas.eb.vdms.com/showard/doh
* Found bundle for host faas.eb.vdms.com: 0x562377afc3f0 [serially]
* Server doesn't support multi-use (yet)
* Trying 152.195.122.71...
* TCP_NODELAY set
* Hostname 'faas.eb.vdms.com' was found in DNS cache
* Trying 152.195.122.71...
@R4wm
R4wm / gist:5a10293dbd849b480da900a8b272f1b5
Created January 27, 2019 21:31
chome headless screenshot, does not include basic auth
chromium --headless --disable-gpu --screenshot --window-size=1280,1696 http://google.com
@R4wm
R4wm / get_bat.sh
Created February 1, 2019 20:14
Commercial break says: oh new box?? No bat? No problem, run get_bat.sh now!
#!/bin/bash
#########################################################
# Dirty script to get bash installed (like on fresh vm) #
#########################################################
wget https://github.com/sharkdp/bat/releases/download/v0.9.0/bat-musl_0.9.0_amd64.deb
dpkg -i bat-musl_0.9.0_amd64.deb
@R4wm
R4wm / get_emacs.sh
Last active February 19, 2019 21:34
installs emacs
#!/bin/bash
emacs_url='http://ftp.wayne.edu/gnu/emacs/emacs-25.3.tar.xz'
echo "Downloading tar from $emacs_url"
apt install libncurses5-dev/xenial -y
cd /tmp
curl -s "$emacs_url" -o emacs-25.3.tar.xz
tar -xvf emacs-25.3.tar.xz
cd emacs-25.3
@R4wm
R4wm / svn_notes.txt
Last active June 25, 2021 22:51
svn why,...
# Turn on exe on file
svn propset svn:executable on
# Turn off exe on file
svn propdel -R svn:executable
@R4wm
R4wm / create_kjv_es_index.sh
Last active May 19, 2019 21:40
Create Elasticsearch Index for King James Bible
#!/bin/bash
curl https://raw.githubusercontent.com/R4wm/elastic_kjv/master/data/esBulk.json -o /tmp/kjv_es_bulk_payload.json
curl -XPOST -H"Content-Type: application/json" http://localhost:9200/bible/_bulk --data-binary @/tmp/kjv_es_bulk_payload.json
curl http://localhost:9200/_cat/indices?v
curl -XPUT http://localhost:9200/bible/_settings -H"content-type: application/json" -d '{"number_of_replicas": 0}'
@R4wm
R4wm / stuff and stuff
Created June 30, 2019 05:38
2 whoami
lfs chroot) I have no name!:/# whoami
root
(lfs chroot) I have no name!:/# which
bash: which: command not found
(lfs chroot) I have no name!:/# find . -iname "whoami" -print
./tools/bin/whoami
./tools/lib/bash/whoami
(lfs chroot) I have no name!:/# file ./tools/bin/whoami
./tools/bin/whoami: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /tools/lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
(lfs chroot) I have no name!:/#
@R4wm
R4wm / fan.go
Created July 10, 2019 06:43
Fan In demonstration
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
fmt.Println("start main")