Skip to content

Instantly share code, notes, and snippets.

@faisalthaheem
faisalthaheem / rc.local
Created March 3, 2022 01:14
autossh to jumpbox with reverse proxy
#should be placed at /etc/rc.local and marked executable (+x)
#package autossh should be installed
#this script will automatically establish ssh connection to remote host on boot as well as restore it in case the connection breaks
#the following example reverse proxies port 4000 on host to port 80 on localhost (localhost = originating server where this script runs)
#!/bin/bash
autossh -M 10984 -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" \
-i /path/to/id_rsa -N -g -R 127.0.0.1:4000:127.0.0.1:80 user@host
exit 0
@faisalthaheem
faisalthaheem / gist:2a366368ddeca9a11cedb3486ee49f50
Created March 3, 2022 01:00
iptables rules for oracle cloud to open web and nfs
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT && \
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT && \
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 111 -j ACCEPT && \
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 2049 -j ACCEPT && \
sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 111 -j ACCEPT && \
sudo iptables -I INPUT 6 -m state --state NEW -p udp --dport 2049 -j ACCEPT && \
sudo netfilter-persistent save
@faisalthaheem
faisalthaheem / gist:3f90811d94813cc555b08ba4d5013adf
Last active April 11, 2022 22:33
GST RTSP pipelines collection
#from rtsp server android app
'rtspsrc location=rtsp://192.168.1.193:5554/camera latency=0 ! rtph264depay ! avdec_h264 ! videorate max-rate=1 ! decodebin ! videoconvert ! video/x-raw, format=BGR ! queue max-size-buffers=10 ! jpegenc quality=25 ! jpegparse ! appsink name=sink'
#big buck bunny
'rtspsrc location=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov latency=0 ! rtph264depay ! avdec_h264 ! videorate max-rate=15 ! decodebin ! queue max-size-buffers=10 ! jpegenc quality=25 ! jpegparse ! appsink name=sink'
# example of mjpeg stream from a typical axis camera or esp32
# souphttpsrc location=http://x.y.z.a:8090/mjpg/video.mjpg?timestamp=1564650227443 ! multipartdemux single-stream=true ! image/jpeg,width=320,height=240,framerate=3/1 ! appsink name=sink
#Example of an RTSP source
@faisalthaheem
faisalthaheem / gist:e1bb255e71916cda5c31751452f9f24a
Created November 19, 2021 12:37
Using polkadotJS to execute multisig transactions on substrate based nodes
Prepare call data (Who wants to transfer how much to whom) and serialize to hex encoded string
The above can be prepared by using the Send button on Accounts screen for the source multisig address, once
the required informaiton is entered and the "Send" button is pressed, the Sign transaction popup will appear
with the prepared call data under "multisig call data" at the bottom of the dialog.
Then on intrinsics
as [Alice] submit [multisig::asMulti] with [Threshold=2] [otherSignatories=Bob] [call=prepared call data] [maxWeight=500000000000 or a sufficient value]
Sign as Alice and note the block number for the withdrawal [balances.Withdraw] in network explorer
as [Bob] submit [multisig::asMulti] with [Threshold=2] [otherSignatories=Alice] [call=prepared call data] [TimePoint=original timepoint from first leg of transactio] [maxWeight=500000000000 or a sufficient value]
pip3 uninstall jupyter jupyter_core jupyter-client jupyter-console notebook
@faisalthaheem
faisalthaheem / gist:14041b74ea4ed0e7342fcb4b71c64e61
Created October 4, 2019 14:04
esp32 cam live stream play with gstreamer
gst-launch-1.0 souphttpsrc location=http://192.168.230.113:81/stream is-live=true ! queue ! jpegdec ! autovideosink
@faisalthaheem
faisalthaheem / gist:3e72754d1385b22db85c6004c414e84b
Created October 4, 2019 14:04
esp32 cam live stream play with gstreamer
gst-launch-1.0 souphttpsrc location=http://192.168.230.113:81/stream is-live=true ! queue ! jpegdec ! autovideosink
@faisalthaheem
faisalthaheem / gist:e6dc156ab3f6c1e428def43f44ccf975
Created August 27, 2017 20:34
libreelec changing default download location for transmission torrent client on raspberry pi2
modify the file at the following location
/storage/.kodi/userdata/addon_data/service.transmission/settings.xml