An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Git-push takes a lot of work figuring out what files need to be pushed. The local copy also needs to query upstream about its current state before it can decide whether a pull is necessary before push.
A local commit, on the other hand, takes almost no work compared to git-push.
Because Gist / file update using the REST API is nothing but a file-ransfer over https + a local commit@upstream, it is supposed to be faster than git-push.
port=<port> # Choose your local port that your server will listen to
file=<filename> # Choose file where <subdomain.localhost.run> will be stored
# Create tunnel in background
ssh -n -R 80:localhost:$port [email protected] -- --output json --no-inject-http-proxy-headers --no-inject-proxy-protocol-header 2>/dev/null | jq --unbuffered -r '.address' > ${file} &
key=<random but unique key> # Such as the hash of your email id!
########### Server:
mkfifo pipe
bash --rcfile <(echo 'PS0="$(tput cuu1; tput ed)"') -i <pipe |&
curl -sf -N -T . https://pipeto.me/${key} >pipe
chroot
#### Jail :> Confine a command's access within given root directoryrunuser
#### Run command as another user. Compare su
stdbuf
[-oL] command #### Line buffering in outputrlwrap
[-cr -aPassword: -p -S -P -o] command #### GNU Readline + History + TAB-Autocompletion + Colored prompt + Password hidingfold
#### Pretty line wrappingwrap
#### Pretty line wrappingpr
### Paginate text file - prettifymore
less
tty
### Print the file name of the terminal connected to standard inputHeroku offers PaaS with a generous free-tier of 550 hours/month without requiring any credit-card validation. Official support is for Node.js, Python, Go, Ruby etc. But what if you just need to run a bash script, may be a netcat based server? Or you simply need to serve a webpage over http or https, and all you know is bash? (Of course you can also use the free services of x10hosting.com for the latter.)
Here are some simple steps to deploy a bash-script at Heroku.
git init
the directory that contains your bash scriptheroku login
#!/usr/bin/env bash | |
# Description: A simple way to generate 128-bit Universally/Globally Unique Identifiers in GNU/Linux | |
# Usage: ./UUID-GUID.bash ["Any text you wanna put in"] | |
# Remark: Perhaps the use of so many variables is overkill, but Hey! It's fun ;-) | |
# Author: Somajit Dey <[email protected]> 2021 | |
user_element="${1}" # Passed by the user as parameter (optional) | |
device_element="$(cat /sys/class/net/eth0/address)" # MAC address |
#!/bin/bash | |
socat -v -T0.05 tcp-l:8081,reuseaddr,fork system:"echo 'HTTP/1.1 200 OK'; echo 'Connection: close'; echo; cat" |
1 | |
2 // Examples for using socat (and filan) | |
3 | |
4 | |
5 //"$" means normal user, "#" requires privileges, "//" starts a comment | |
6 | |
7 /////////////////////////////////////////////////////////////////////////////// | |
8 // similar to netcat | |
9 | |
10 // connect to 10.1.1.1 on port 80 and relay to and from stdio |