Skip to content

Instantly share code, notes, and snippets.

@ibrezm1
ibrezm1 / id_rsa
Last active December 24, 2022 03:55
Set-neverinstall
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABCv5JnpN5
gCMM5FQHIIVlKzAAAAEAAAAAEAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQDISb3+zwrU
dsjRtWqso6Fws1cHulG+xfwQ4J+GcHa1kCB46wkhQskyyfSDZoebfJFwpYUHdOpZzohMoc
q6fVuutwY76IezObXf3IsYDZw1my/3Qk455c6Rs7QHtWkjBd/Nhf6cITKJA4VoXGFkJ2FL
IkXacVEg4K3l6P2MjUUb6UB/OVkoxXng1E0eAyIswDbLgO1widuvXXG/yjKDC2xxfo282X
ri9dbdlU7AmcCO+GaG8SzBArFUM15ad4EE3hHbdq6oUOCij3uUUonR5esnZpsD+AUwAN7Z
y4PCTz73q3iY+KlSwC5Tehia2M22u6fWyYRdcQS3GVKHkVgQymplLUXDKSW5ZTPc1IyJzG
lplvpI9F/Hk16rk0VyKS8mt+ELystTmnmNIoEJXlP5U7u827jaE/qqyXIX/s1djEuuena4
dMkghOaAJry/Qr1xSUwMksw5OBmsK+zOHhHqvZQy470wPHDXv42MIiQISt+HfUYMMp4Srr
@ibrezm1
ibrezm1 / Windows installation.ps1
Last active November 25, 2022 09:49
Windows installation
sudo grub-reboot 2 && sudo reboot
sudo grub-set-default <num>
27 systemd-analyze
28 systemd-analyze blame
# Enable RDB from system properties
# Enable Lan from Turn off on windows features
@ibrezm1
ibrezm1 / flask-apshedular.py
Last active November 6, 2022 04:45
Flask demo for ap shedular cron type , Delete the sqlite file first
""" Demonstrating APScheduler feature for small Flask App. """
from apscheduler.schedulers.background import BackgroundScheduler
from flask import Flask
from datetime import datetime
from pytz import timezone
tz = timezone('US/Eastern')
print(datetime.now(tz) )
# https://gist.github.com/ivanleoncz/21293b00d0ea54db8ee3b57fb1170ddf
# 341 vi ~/.profile
# 342 ssh-copy-id [email protected]
# 344 source ~/.profile
# 343 pls
# Usage
# Backup current folder ( will exclude . files )
# pbkp
# List remote
# $ pls
@ibrezm1
ibrezm1 / main.tf
Created September 29, 2022 05:23
Teraform setup and learn
# install terraform steps and interactive web browser
# https://learn.hashicorp.com/tutorials/terraform/install-cli
provider "google" {
#version = "3.5.0"
# credentials = file("/downloads/compute-instance.json")
# OR
# use gcloud auth application-default login/revoke
project = "zeta-yen-319702"
region = "us-central1"
@ibrezm1
ibrezm1 / movepythonpackages.sh
Last active September 28, 2022 02:44
Pip file movement to prod servers
# Reference
# https://stackoverflow.com/questions/7300321/how-to-use-pythons-pip-to-download-and-keep-the-zipped-files-for-a-package
mkdir /temp/pypack
pip freeze > requirements.txt
pip download -d /tmp -r requirements.txt
# zip and move te requirements file also so that it can e used on target
@ibrezm1
ibrezm1 / botdets.txt
Created August 10, 2022 05:08
Microsoft Bot
https://dev.botframework.com/bots
https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-create-bot?view=azure-bot-service-4.0&tabs=csharp%2Cvs
https://www.youtube.com/watch?v=-FHc_lZ6jJY
https://youtu.be/RjGVOFm39j0?t=651
@ibrezm1
ibrezm1 / settings.json
Created July 23, 2022 18:17
settings.json for VScode
{
"terminal.integrated.profiles.windows": {
"PowerShell": { "source": "PowerShell", "icon": "terminal-powershell" },
"GitBash": {
"path": "${env:windir}\\System32\\cmd.exe",
"args": ["/k","C:\\Tools\\cmder\\vendor\\git-for-windows\\bin\\bash.exe"]
},
"Cmder": {
"path": "${env:windir}\\System32\\cmd.exe",
"args": ["/k", "C:\\Tools\\cmder\\vendor\\bin\\vscode_init.cmd"]
#!/usr/bin/env python3
#$ python3 ip-to-hostname.py 216.58.196.4
#Address: 216.58.196.4
#Host: ('kul08s09-in-f4.1e100.net', [], ['216.58.196.4'])
import socket
import sys
address = sys.argv[1]
host = socket.gethostbyaddr(address)
@ibrezm1
ibrezm1 / subnet.py
Last active June 22, 2022 05:05 — forked from nboubakr/subnet.py
A simple python script converts a Classless Inter-Domain Routing (CIDR)-formatted IP address into an IP range and netmask.
#!/usr/bin/env python
# python subnet.py 200.100.33.65/26
# from: curl -O https://gist.github.com/ibrezm1/4b4274006dc2a5d5ad48e6b2c395633b/subnet.py
import sys
# Get address string and CIDR string from command line
(addrString, cidrString) = sys.argv[1].split('/')
# Split address into octets and turn CIDR into int