Skip to content

Instantly share code, notes, and snippets.

@meyt
meyt / acc2sql.sh
Last active May 6, 2023 09:08
Export MS Access database (accdb, accde) in linux+mdbtools
View acc2sql.sh
#!/bin/bash
# tested with mdbtools@0.9.1-1 on Debian@11
#
# Setup:
# sudo apt install mdbtools -y
#
# Usage:
# bash ./acc2sql.sh mydb.accdb mydb.sql
##
@meyt
meyt / httpbench.py
Last active April 13, 2023 00:09
Measure HTTP request and response time in Python
View httpbench.py
import socks
from time import time
from dataclasses import dataclass
from http.client import HTTPConnection, HTTPSConnection, HTTPResponse
from urllib.parse import urlparse
USER_AGENT = (
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) "
@meyt
meyt / csgo-sourcemod.sh
Last active December 13, 2022 13:23
Install CSGO Sourcemod on Linux
View csgo-sourcemod.sh
#!/bin/bash
# sourcemod is based on metamod
tempdir="/opt/csgo-addons"
csgodir="/home/steam/csgo-server/csgo"
mkdir $tempdir
cd $tempdir
@meyt
meyt / pex-build.md
Last active December 12, 2022 02:00
pex build example
View pex-build.md

showmyip/__init__.py

# showmyip/__init__.py
from pyray import *
import requests

def main():
    init_window(200, 200, "Whats My IP?")
 while not window_should_close():
@meyt
meyt / mass-useradd.sh
Last active September 24, 2022 14:57
Batch useradd linux
View mass-useradd.sh
#!/bin/bash
# Usage:
# bash ./mass-useradd.sh 20
cnt="$1"
prefix="user"
for n in `seq $cnt`;do
user="$prefix$n";
pass=$(openssl rand -base64 12);
#pass=$(shuf -i 1000000000-9999999999 -n 1);
@meyt
meyt / yektanet.client.js
Created July 19, 2022 17:27
yektanet nuxt plugin
View yektanet.client.js
export default (ctx) => {
if (process.env.NODE_ENV !== 'production') return
const i = '<CLIENT_KEY>'
const w = window
const n = 'yektanet'
w.yektanetAnalyticsObject = n
w[n] = w[n] || function () { w[n].q.push(arguments) }
w[n].q = w[n].q || []
const a = new Date()
const r = '' + a.getFullYear() + '0' + a.getMonth() + '0' + a.getDate() + '0' + a.getHours()
@meyt
meyt / App.js
Last active June 11, 2022 11:02
Navigation-back detector for vue@2 vue-router@3 http://codepen.io/barname_nevis/pen/jOZQwby
View App.js
// basic usage
import Vue from 'vue'
import VueRouter from 'vue-router'
import VueNavbackDetector from './vue-navback-detector.js'
const routes = []
const router = new VueRouter({ routes })
Vue.use(VueNavbackDetector, { router })
new Vue({ router }).$mount('#app')
@meyt
meyt / jcal-debian-install.sh
Created May 3, 2022 12:11
jcal install script on Debian (tested on debian11)
View jcal-debian-install.sh
#!/bin/bash
sudo apt install -y build-essential autotools-dev automake libtool libreadline-dev
git clone --depth=1 https://github.com/persiancal/jcal.git
cd jcal/sources
bash ./autogen.sh
./configure --prefix=/usr
make
sudo make install
@meyt
meyt / deadbeef-infobar-ng-build.sh
Created April 7, 2022 22:43
deadbeef infobar-ng plugin build on ubuntu20.04
View deadbeef-infobar-ng-build.sh
#!/bin/bash
# os: ubuntu 20.04
# deadbeef: 1.8.8
#
# run as normal user
wget https://www.deb-multimedia.org/pool/main/d/deadbeef-dmo/deadbeef-plugins-dev_1.8.8-dmo2_all.deb
sudo apt install -y deadbeef-plugins-dev_1.8.8-dmo2_all.deb
sudo apt install -y build-essentials libgtk-3-dev libxml++2.6-dev
@meyt
meyt / raychat.client.js
Created April 7, 2022 02:34
raychat nuxt plugin
View raychat.client.js
export default function () {
if (process.env.NODE_ENV !== 'production') return
const i = '<CLIENT_KEY>'
const w = window
const l = w.localStorage.getItem('rayToken')
const g = document.createElement('script')
g.async = true
g.src = 'https://app.raychat.io/scripts/js/' + i + '?href=' + w.location.href
if (l) g.src += '&rid=' + l
document.getElementsByTagName('head')[0].appendChild(g)