Skip to content

Instantly share code, notes, and snippets.

View bijoy26's full-sized avatar
🎯
Focusing

Anjum Rashid bijoy26

🎯
Focusing
View GitHub Profile
@nicolasdao
nicolasdao / open_source_licenses.md
Last active April 29, 2025 00:59
What you need to know to choose an open source license.
@orian
orian / crypt.py
Last active December 21, 2024 19:14 — forked from fideloper/crypt.py
Decrypt Laravel-encrypted value
# Python3 code below
import os
import base64
import json
from Crypto.Cipher import AES
from phpserialize import loads
import hashlib
import hmac
@evanwill
evanwill / gitBash_windows.md
Last active May 6, 2025 00:17
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@roughy
roughy / SimpleRequestHandler.py
Created March 23, 2016 16:03
Start a simple Python Http server to handle requests for test purposes.
# run with $> python SimpleRequestHandler.py 8081
from BaseHTTPServer import HTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler
import json, sys
port = 8080
if len(sys.argv) == 2:
port = int(sys.argv[1])
@kolargol
kolargol / ip_scan_bl.sh
Last active May 11, 2022 18:29
bash script that detect iphone proximity and takes actions when it arrives/leave range. This example terminate all SSH sessions on server where it is running when iPhone leave range.
#!/bin/bash
# Script that detects arrival,presence,departure of iPhone based on bluetooth. It also execute actions
# In this script it terminate SSH sessions when defined device lefts range
# Requires: bluetooth, hcitools, curl
# Written by Zbyszek Żółkiewski, please visit: http://blog.onefellow.com
# Install:
# - copy ip_scan.sh to /usr/local/bin/ on your local machine/server
# - chmod ugo+x /usr/local/bin/ip_scan.sh
# - change 'ip_iphone' variable to point you your iPhone mac-address
#!/bin/bash
# Script that detects arrival,presence,departure of iPhone on local network
# Requires arp-scan tool
# Written by Zbyszek Żółkiewski, please visit: http://blog.onefellow.com
# Install:
# - copy ip_scan.sh to /usr/local/bin/
# - chmod ugo+x /usr/local/bin/ip_scan.sh
# - change 'ip_iphone' variable to point you your iPhone IP
# - option: insert your boxcar_id otherwise comment-out boxcar_send function in action_after_grace
# - put into cron: echo "*/1 * * * * root /usr/local/bin/ip_scan.sh" > /etc/cron.d/iphone_scan , or whatever user you want
@touilleMan
touilleMan / SimpleHTTPServerWithUpload.py
Last active April 23, 2025 09:52 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@mildred
mildred / server.py
Created October 9, 2014 10:20
Python 3 http.server with PUT support
#!/usr/bin/env python
import argparse
import http.server
import os
class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_PUT(self):
path = self.translate_path(self.path)
if path.endswith('/'):
@soheilhy
soheilhy / nginxproxy.md
Last active May 14, 2025 20:17
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers