Skip to content

Instantly share code, notes, and snippets.

@mousavian
mousavian / twitter-blocker.js
Created November 10, 2022 08:29
Twitter Ato report using Tamperbmonkey
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant none
// ==/UserScript==
@mousavian
mousavian / spacewalk-answers.txt
Created March 23, 2020 23:52
spacewalk-setup --external-oracle --answer-file=./spacewalk-answers.txt
admin-email =
ssl-set-org =
ssl-set-org-unit =
ssl-set-city =
ssl-set-state =
ssl-set-country =
ssl-password =
ssl-set-email =
ssl-config-sslvhost = N
db-backend=oracle
@mousavian
mousavian / .vimrc
Last active December 18, 2019 01:37
" use filetype-based syntax highlighting, ftplugins, and indentation
syntax on
filetype plugin indent on
colorscheme challenger_deep
set number " show line numbers
set nowrap " nowrap lines
set encoding=utf-8 " set encoding to UTF-8 (default was "latin1")
" set mouse=a " enable mouse support (might not work well on Mac OS X)
@mousavian
mousavian / bare.sh
Created October 31, 2019 01:24
Removes passphrase from private key (Supports OpenSSH and RSA)
#!/bin/bash
# Usage:
# RSA:
# ./bare.sh my-priv-key -t rsa
#
# OpenSSH
# ./bare.sh my-priv-key -t openssh
#
@mousavian
mousavian / k8s-cronjob-suspend.sh
Last active September 15, 2023 08:40
Suspending all cronjobs in all namespaces in kubernetes
#!/bin/bash
for ns in $(kubectl get ns -o jsonpath="{.items[*].metadata.name}"); do
for cj in $(kubectl get cronjobs -n "$ns" -o name); do
kubectl patch "$cj" -n "$ns" -p '{"spec" : {"suspend" : true }}';
done
done
@mousavian
mousavian / akamai.api.sh
Created July 22, 2018 06:57
Akamai Open API Curl command example
#!/bin/bash
readonly CLIENT_SECRET=""
readonly CLIENT_TOKEN=""
readonly ACCESS_TOKEN=""
readonly HOST=""
readonly REQUEST_PATH="/papi/v1/search/find-by-value"
readonly REQUEST_BODY='{"propertyName":"myProperty"}'
readonly REQUEST_TYPE="POST"
@mousavian
mousavian / axios-vs-superagent.js
Last active January 23, 2018 06:59 — forked from natesilva/axios-vs-superagent.js
Compare performance of Axios vs. SuperAgent when running under Node.js
const HttpAgent = require('agentkeepalive')
const superagent = require('superagent')
const Benchmark = require('benchmark')
const axios = require('axios')
const http = require('http')
var suite = new Benchmark.Suite()
const targetUrl = 'http://httpbin.org/ip'
const axiosInstance = axios.create({
baseURL: 'http://httpbin.org',
@mousavian
mousavian / scanit_bot.sh
Created December 19, 2016 18:41
control scanner using telegram bot
KEY="<telegram-token>"
CHATID="<CHATID>"
COUNTER=1
replay() {
curl -s -d "chat_id=$CHATID&text=$1" "https://api.telegram.org/bot$KEY/sendMessage"
}
while [[ true ]]; do
URL_GET="https://api.telegram.org/bot$KEY/getUpdates?limit=1&update_id=$UPDATEID&offset=$((UPDATEID + 1))"
import Html exposing (text)
import List
type alias Date =
{ year : Int
, month : Int
, day : Int
}
gregorian_days_in_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
import Html exposing (text)
islamic_epoch = 1948439.5
gregorian_epoch = 1721425.5
persian_epoch = 1948320.5
type alias Date =
{ year : Int
, month : Int
, day : Int