Skip to content

Instantly share code, notes, and snippets.

View HirbodBehnam's full-sized avatar

Hirbod Behnam HirbodBehnam

View GitHub Profile
@HirbodBehnam
HirbodBehnam / ChangeIP-Now-DNS.sh
Last active April 5, 2019 05:54
This script cycles IP addresses of a domain name registered with now-dns.com (Ubuntu and Centos)
#!/bin/bash
USERNAME="Now dns username"
PASSWORD="Now dns password"
HOSTNAME="testsite.now-dns.net" #Your domain
IP=()
#Create a file named ip.txt and add all of your IP addresses in it separated by new line
input="ip.txt"
while IFS= read -r var
do
IP+=("$var")
@HirbodBehnam
HirbodBehnam / BlockDetector.sh
Created April 7, 2019 11:22
Check if a server is blocked with ssh, results are send through a telegram bot
#!/bin/bash
TELE_BOT_API="Get your tag from @BotFather"
MY_ID="Your telegram ID. This is a number"
#Save your ip addresses and ports in a file named ip.txt, split by new line
#Save like ip:port of your ssh connection for example if your host is 1.1.1.1 and your ssh port is 223 it must be entered like 1.1.1.1:223
input="ip.txt" #Filename to read ip from
TIME_OUT=30 #Set timeout for ssh connection
while true; do
IP=()
while IFS= read -r var
@HirbodBehnam
HirbodBehnam / Rare Math Calculations PC.md
Last active October 24, 2020 06:47
Rare Math Calculations Privacy Policy

Privacy Policy

Hirbod Behnam built the Rare Math Calculations app as an Ad Supported app. This SERVICE is provided by Hirbod Behnam at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Rare Math Calculations unless otherwise defined in this Privacy Policy.

@HirbodBehnam
HirbodBehnam / Github-Restriction-Warning-Remover.js
Last active December 1, 2019 12:42
You cannot remove the "Due to U.S. trade controls law restrictions" alert on github? Use this script with tampermonkey!
// ==UserScript==
// @name Remove Github Racism
// @namespace http://tampermonkey.net/
// @version 1
// @description Your account been restricted by github and you can see the big fucking "Due to U.S..."? No more fam! FUCK GITHUB AND USA
// @author Hirbod Behnam
// @match https://*.github.com/*
// @grant none
// ==/UserScript==
@HirbodBehnam
HirbodBehnam / Golang-Cross-Compile.sh
Last active August 16, 2019 16:15
Cross compile golang on linux with this script.
#!/usr/bin/env bash
#Main file from https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04
#I just edited the platform; I'm just backing up it here
package=$1
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
exit 1
fi
package_split=(${package//\// })
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
namespace TestConsole
{
// From https://stackoverflow.com/a/41392145/4213397
@HirbodBehnam
HirbodBehnam / tg.sh
Last active June 25, 2024 05:50
A dead simple script to upload files on your server through Telegram bot
#!/bin/bash
# This is a simple script that takes some files as arguments and sends them to a special chat
# Just create a new bot at @BotFather and get your chat ID from @myidbot and enter them here
# You can also make a shortcut in '~/.bashrc' like "alias tg='bash /opt/scripts/tg.sh'"
# After that restart bash and use it like 'tg file1.txt file2.jpg'
# EDIT TOKEN and CHAT_ID:
TOKEN="TOKEN"
CHAT_ID="12341234"
# Make sure curl is installed
for arg in "$@"
@HirbodBehnam
HirbodBehnam / AES-GCM-File.cs
Created February 1, 2020 18:41
A simple program to encrypt and decrypt a file using AES-GCM and Bouncy Castle
using System;
using System.IO;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Modes;
using Org.BouncyCastle.Crypto.Parameters;
namespace TestConsole
{
class Program
@HirbodBehnam
HirbodBehnam / Custom-AES-GCM.cs
Last active January 23, 2024 03:09
A fucked up way to encrypt files with AES-GCM, C# and bouncy castle
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.Crypto.Modes;
using Org.BouncyCastle.Crypto.Parameters;