Skip to content

Instantly share code, notes, and snippets.

View rm3l's full-sized avatar
💭
I may be slow to respond.

Armel Soro rm3l

💭
I may be slow to respond.
View GitHub Profile
@rm3l
rm3l / oc-pull-secret-update-global.sh
Last active December 21, 2023 20:28 — forked from nickboldt/oc-pull-secret-update-global.sh
add tokens/pwds for quay.io (and/or for registry.redhat.io) to your openshift's global or per-project pull secret
#!/bin/bash
# set your own logins!
#QUAY_USER="****"
#QUAY_TOKEN="****"
#RRIO_USERNAME="****"
#RRIO_PASSWORD="****"
# login to quay.io
REGISTRY="quay.io"
@rm3l
rm3l / proc_net_tcp_decode
Created March 3, 2023 12:13 — forked from jkstill/proc_net_tcp_decode
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
#!/usr/bin/env lua
local socket = require("socket")
local use_ssl, ssl = pcall(require, "ssl")
local Blynk = require("blynk.socket")
local Timer = require("timer")
assert(#arg >= 1, "Please specify Auth Token")
local auth = arg[1]
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@rm3l
rm3l / publish-mavencentral.gradle
Created March 1, 2021 23:10 — forked from zsmb13/publish-mavencentral.gradle
Basic MavenCentral script
apply plugin: 'maven-publish'
apply plugin: 'signing'
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
from android.sourceSets.main.java.srcDirs
from android.sourceSets.main.kotlin.srcDirs
} else {
from sourceSets.main.java.srcDirs
@rm3l
rm3l / script-template.sh
Created December 16, 2020 19:52 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]

How to use this code

  1. Add the build_pull_request.sh to the root of your git repository;
  2. Add the android.yml file to .github/workflows/;
  3. Make build_pull_request.sh executable using: chmod +x build_pull_request.sh;
  4. Commit your code and push the changes

LICENSE

# MIT License
@rm3l
rm3l / networkCommand.md
Created February 11, 2020 23:47 — forked from raulmoyareyes/networkCommand.md
Linux command to check Internet connection speed.

# View public IP

  • curl -s checkip.dyndns.org | sed 's#.Address: (.)</b.*#\1#'
  • wget -qO - icanhazip.com
  • curl ifconfig.me
  • curl ident.me
  • dig +short myip.opendns.com @resolver1.opendns.com
  • lynx -dump ifconfig.me | grep 'IP Address'
  • curl ipecho.net/plain
  • curl bot.whatismyipaddress.com
  • curl ipinfo.io
@rm3l
rm3l / ruby_http_post.rb
Created January 20, 2020 23:30 — forked from kinopyo/ruby_http_post.rb
Pure ruby code posting form data with parameters, and get the response.
require 'net/http'
require 'uri'
#1: Simple POST
res = Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'),
{'q' => 'ruby', 'max' => '50'})
puts res.body
#2: POST with basic authentication
res = Net::HTTP.post_form(URI.parse('http://jack:pass@www.example.com/todo.cgi'),