Skip to content

Instantly share code, notes, and snippets.

View ioxorg's full-sized avatar

Alireza ioxorg

  • United Arab Emirates
  • 09:13 (UTC +04:00)
View GitHub Profile
@ioxorg
ioxorg / Lrnz.py
Created September 13, 2021 17:39
Lorenz attractor
import numpy as np
import matplotlib.pyplot as plt
def lorenz(x, y, z, s=10, r=28, b=2.667):
"""
Given:
x, y, z: a point of interest in three dimensional space
s, r, b: parameters defining the lorenz attractor
Returns:
@ioxorg
ioxorg / pi.c
Created October 16, 2021 21:50
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
// this program compute how many digits of pi u want ! by spigot algorithm
// the idea is that to write pi in a mixed radix representation and convert it
// to 10 radix representation with elementry functions on integers.
// https://en.wikipedia.org/wiki/Spigot_algorithm
#define F 0x2710ull
@ioxorg
ioxorg / disable-kva.cmd
Created December 14, 2021 18:13
Disabling CVE-2017-5715 (Spectre Variant 2) and CVE-2017-5754 (Meltdown) mitigations
REM To disable mitigations for CVE-2017-5715 (Spectre Variant 2) and CVE-2017-5754 (Meltdown)
REM https://support.microsoft.com/en-us/help/4072698/windows-server-speculative-execution-side-channel-vulnerabilities
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 3 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 3 /f
// gcc -luring nosyscall_iouring.c
#include <stdio.h>
#include <netinet/in.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <liburing.h>
int ENTRIES = 1024;
"""Quantum field theory example
* https://en.wikipedia.org/wiki/Quantum_field_theory
This particular example is a work in progress. Currently it calculates the
scattering amplitude of the process:
electron + positron -> photon -> electron + positron
in QED (https://en.wikipedia.org/wiki/Quantum_electrodynamics). The aim
is to be able to do any kind of calculations in QED or standard model in
SymPy, but that's a long journey.
"""

Keybase proof

I hereby claim:

  • I am rf3l on github.
  • I am rf3l (https://keybase.io/rf3l) on keybase.
  • I have a public key ASByyAw21KjOPW4OkwGDoHI6J_1047FHYPLEp1304M7ZRgo

To claim this, I am signing this object:

#!/bin/bash -e
usage(){
echo "kubectl ssh <pod_name> [-n | --namespace] [-u | --user] [<ssh-parameters>]"
}
get_node_ip(){
pod_name=$1
namespace=$2
const best_ips = 'http://bot.sudoer.net/best.cf.iran.all'
let operator_to_ips = {};
const https_ports = [443, 2053, 2083, 2087, 2096, 8443]
const subLink = 'https://raw.githubusercontent.com/mahdibland/ShadowsocksAggregator/master/sub/sub_merge.txt';
const alpns = ['h2', 'http/1.1', 'h2,http/1.1', ''];
const useragents = ['chrome', 'firefox', 'safari', 'random', 'randomized']
export default {
async fetch(request) {
let url = new URL(request.url);
#!/bin/bash
read -p 'Enter Email : ' email
read -p 'Enter Domain : ' domain
function install_socat() {
apt install socat -y
}
function install_acme() {
curl https://get.acme.sh | sh
@ioxorg
ioxorg / CLocalApiClient.diff
Created May 7, 2023 11:19
ugly CLocalApiCLient.php patch
--- /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php.orig 2023-03-08 16:23:26.555055621 +0100
+++ /usr/share/zabbix/include/classes/api/clients/CLocalApiClient.php 2023-03-08 16:22:46.378217849 +0100
@@ -128,6 +128,13 @@
$newTransaction = true;
}
+ // UGLY GRAFANA DATASOURCE HACK
+ // rename "user" param to "username" when present
+ if ($params['user'] ?? null) {
+ $params['username'] = $params['user'];