Skip to content

Instantly share code, notes, and snippets.

View farooqkz's full-sized avatar

Farooq Karimi Zadeh farooqkz

View GitHub Profile
@b-simjoo
b-simjoo / ProxyAgent.py
Last active July 7, 2023 18:42
Proxy agent
#! /usr/bin/python3
# I wrote this script so that my personal computer running Ubuntu
# always has an active connection with the proxy server.
#
# Note that I am using my ssh config file, you can define a host there or
# you can type the whole command here
import notify2
import requests
@death
death / gibber.lisp
Last active April 29, 2020 14:18
Tuberculosis gibber demo
(defpackage #:tuberculosis/demo/gibber
(:use #:cl #:tuberculosis #:monotonic-clock)
(:import-from #:alexandria #:random-elt)
(:export #:main))
(in-package #:tuberculosis/demo/gibber)
(defun benchmark-redisplays (function)
(let ((start 0)
(elapsed 0)
@maxidorius
maxidorius / matrix-howto-synapse_coturn.md
Last active November 2, 2023 07:12
Working config for VoIP in Matrix: synapse + coturn

This configuration is provided AS-IS and as an example/reference for those who do not find a working configuration for themselves. It is not always kept up to date and no support is provided.

Assuming:

  • Your Matrix domain: example.org
  • Your TURN domain (arbitrary): turn.example.org
  • Your Public IP: 1.2.3.4
  • Your Private IP for the box hosing the services: 10.11.12.13
  • A shared secret between synapse and coturn: ThisIsASharedSecret-ChangeMe
  • You want Firefox compatiblity (TURNS only is not supported)
<!DOCTYPE html>
<html>
<head><title>SOUND</title></head>
<body>
<div>Frequence: <span id="frequency"></span></div>
<script type="text/javascript">
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var oscillatorNode = audioCtx.createOscillator();
var gainNode = audioCtx.createGain();
@shayanzare007
shayanzare007 / search_in_txt.rb
Created November 21, 2016 12:07
search in text file
#!/usr/bin/ruby
File.open("License.txt") do |f| #open file
f.each_line do |line|
text = [/sh/, /123/] #array for searching
if line =~ text[0] || text[1] #searching in file
puts "[+] Found License: #{line}" #puts founding word
else
puts "[+] License is not found!"
end
@bembu
bembu / telegram_irc_bridge.py
Last active September 20, 2020 20:29
A script that acts as a bridge between IRC and Telegram.
"""
A script that acts as a messaging bridge between Telegram and IRC.
Works in Python 3.x
Installation:
1. pip install pydle
2. go create a Telegram bot by talking to BotFather (https://telegram.me/botfather)
3. create a telegram group, and send a curl to:
curl -s -X POST "https://api.telegram.org/bot<BOT_TOKEN>w/getUpdates"
4. get the group_id from the response
@ubermuda
ubermuda / nginx.conf
Created November 5, 2013 22:13
Proxy a unix socket HTTP server to a tcp port using nginx.
server {
listen 127.0.0.1:9000;
location / {
proxy_pass http://unix:/var/run/docker.sock:/;
}
}
@Starefossen
Starefossen / tmux-cheats.md
Last active April 23, 2024 11:47
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@willurd
willurd / web-servers.md
Last active April 23, 2024 23:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000