Skip to content

Instantly share code, notes, and snippets.

View mobeigi's full-sized avatar
💙
Develop with heart

Mo Beigi mobeigi

💙
Develop with heart
View GitHub Profile
@mobeigi
mobeigi / autoexec.cfg
Last active October 11, 2023 14:47
Byte's CS2 Config
// Byte's CS2 config
// Updated 12/10/2023
echo ""
echo "##########################################"
echo " Executing Byte's autoexec.cfg"
echo "##########################################"
echo ""
// *********** Binds *****************
@mobeigi
mobeigi / reddit_symbol_parser.py
Created October 3, 2021 09:07
Reddit Symbol Parser
import praw
import regex as re
reddit = praw.Reddit(
client_id="client_id",
client_secret="client_secret",
user_agent="MobeigiTest",
)
submission = reddit.submission(id="pfpyxc")
@mobeigi
mobeigi / seed_finder.js
Created August 21, 2021 03:48
Steam Market Seed Finder (CSGOFloat extension)
var seeds = document.getElementsByClassName('csgofloat-itemseed');
var patterns = [101,404,684];
for (var i = 0; i < seeds.length; ++i) {
var seed = Number(seeds[i].textContent.replace('Paint Seed: ', ''));
if (patterns.includes(seed)) {
console.log("Found seed: " + seed);
};
}
@mobeigi
mobeigi / ibkr_to_sharesight.py
Created June 26, 2021 12:56
Convert IBKR Last365CalendarDays (JSON) file to Sharesight Bulk Trades CSV File
import json
from datetime import datetime
# Read Last365CalendarDays.json file
with open('Last365CalendarDays.json') as json_file:
data = json.load(json_file)
def convert_date(date):
date_obj = datetime.strptime(date, "%Y-%m-%dT%H:%M:%S.%fZ")
@mobeigi
mobeigi / cyperpunk_2077_gog_price_scraper.py
Created December 7, 2020 12:11
Cyberpunk 2077 GoG Game Price Scraper
import mechanicalsoup
import json
URL = 'https://menu.gog.com/v1/store/configuration?locale=en-US&currency=USD&country='
country_codes = ['AR','AU','AT','BS','BE','BO','BR','CA','CL','CN','CO','CR','HR','CU','CZ','DK','DO','EC','EG','SV','FI','FR','DE','GR','GT','HN','HK','IN','IE','IL','IT','JM','JP','LU','MX','MA','NL','NZ','NI','NG','NO','PY','PE','PL','PT','PR','RU','SA','ZA','ES','SE','CH','TW','TR','UK','US','UY','VE','SD','II','AF','AL','DZ','AO','AG','AW','AZ','BH','BD','BB','BY','BZ','BM','BT','BW','VG','BN','BG','BF','MM','BI','CM','CV','KY','KM','CG','CY','YE','DJ','DM','GQ','EE','FJ','GA','GM','GH','GD','GN','GW','GY','HT','HU','IS','ID','IR','CI','JO','KE','KW','KP','KG','LA','LV','LB','LR','LI','LT','MG','MY','ML','MT','MR','MN','MC','MZ','NP','AN','NE','OM','PK','PA','PH','QA','RO','KN','LC','VC','WS','SN','SG','SB','SZ','SY','TH','TT','TN','UA','AE','VN','YU','ZW','ZR','ET','KV','AX','AS','AD','AI','AQ','AM','BJ','BA','BV','IO','KH','CF','TD','CX','CC','CD','CK','ER','FK','FO','GF','PF','TF',
@mobeigi
mobeigi / tws.vmoptions
Created November 8, 2020 01:19
TWS VM Options
#
# This file contains VM parameters for Trader Workstation.
# Each parameter should be defined in a separate line and the
# last line must be followed by a line feed. No leading or
# trailing whitespaces are allowed in the same line, where a
# parameter is defined.
#
# Lines starting with a '#' character are treated as comments
# and ignored. Additionally, if a line contains a
# '### keep on update' string, all parameters defined below will
@mobeigi
mobeigi / slack_user_noti_pref_bulk_update.js
Last active October 17, 2022 19:24
Slack User Notification Preference Bulk Update
// Slack User Notification Preference Bulk Update
// By Mo Beigi
const slackTeamId = "EXAMPLE17";
const localConfigJson = JSON.parse(localStorage.localConfig_v2);
const slackUrl = localConfigJson.teams[slackTeamId].url;
let channel_ids = [];
// client.boot contains list of channel ids user is subscribed to amongst other things
await fetch(slackUrl + "api/client.boot?" +
@mobeigi
mobeigi / commit-msg
Created July 25, 2020 13:15
Git Commit Message Hook for JIRA Issue Keys
#!/bin/bash
# The script below adds the branch name automatically to
# every one of your commit messages. The regular expression
# below searches for JIRA issue key's. The issue key will
# be extracted out of your branch name
#
# A variant of grep support the -P flag for PCRE is required
#
REGEX_ISSUE_ID="((?!([A-Z0-9a-z]{1,10})-?$)[A-Z]{1}[A-Z0-9]+-\d+)"
@mobeigi
mobeigi / alertmanager_webhook_payload_example.json
Last active March 1, 2024 07:24
Alertmanager Webhook Payload Example
{
"receiver": "webhook",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"alertname": "Test",
"dc": "eu-west-1",
"instance": "localhost:9090",
@mobeigi
mobeigi / backup.sh
Created July 3, 2020 17:04
Linux Server Backup Script for Files + MySQL Databases
#!/usr/bin/env bash
# Server Backup Script
# Backs up:
# MySQL databases
# Important files on file system
# Variables
TIMESTAMP=$(date +"%d-%m-%Y_%H-%M-%S")
BACKUP_DIR="/root/backups/full"