Skip to content

Instantly share code, notes, and snippets.

View Zibri's full-sized avatar
❤️‍🔥

Zibri Zibri

❤️‍🔥
View GitHub Profile
@Zibri
Zibri / zibri_ssh.patch
Last active March 11, 2020 12:33
Patch for openssh adding option "-Z" so specify source port of connection of both ssh and scp)
diff -u openssh-7.6p1/scp.c openssh-7.6p1Z/scp.c
--- openssh-7.6p1/scp.c 2020-01-15 17:20:57.000000000 +0200
+++ openssh-7.6p1Z/scp.c 2020-01-15 17:19:37.699437700 +0200
@@ -153,6 +153,9 @@
/* This is the program to execute for the secured connection. ("ssh" or -S) */
char *ssh_program = _PATH_SSH_PROGRAM;
+/* This is used to store the source_port specified by -Z */
+char *source_port = NULL;
+
@Zibri
Zibri / eticheck.sh
Last active April 19, 2020 11:49
BASH script to know remaining credit in megabytes from etisalat data simcard
#!/bin/bash
function eticheck ()
{
param=`curl --proxy "" -sI "http://www.etisalat.eg/etisalat/notification/dashboard.html"|grep param|cut -d " " -f 2|tr -d "\r"`
eurl="http://www.etisalat.eg/dashboard/user/profile?dial=param:$param"
msisdn=`curl --proxy "" -qs -H 'DNT: 1' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9,it;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://www.etisalat.eg/etisalat/notification/dashboard.html' "http://www.etisalat.eg/dashboard/user/msisdn?dial=param:$param" --compressed|jq -r .msisdn`
data=`curl --proxy "" -qs -H 'DNT: 1' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9,it;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36' -H 'Accept: application/json, text/plain, */*' -H 'Referer: http://www.e
@Zibri
Zibri / bars.s
Created May 8, 2020 14:35
Vertical bars record by Zibri/RamJam
;---------------------------------------
; Vertical Bars
; By Zibri/RamJam 2020
;---------------------------------------
.ORG $2f5
boot
SEI
newline TSX
@Zibri
Zibri / megarefresh.sh
Last active July 26, 2021 14:33
Refresh MEGA.NZ accounts from expiring.
#!/bin/bash
# install megacmd from mega.nz first.
# put your usernames and passwords
# run this once a month :D
while read a b;do
mega-login &>/dev/null $a $b && mega-logout &>/dev/null && echo refreshed $a || echo error $a
done <<EOF
email1 password1
email2 password2
@Zibri
Zibri / dump_i2c_eeprom.c
Last active August 27, 2021 16:27 — forked from gquere/dump_i2c_eeprom.c
dump I2C EEPROM memory from Linux device ioctl
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/i2c-dev.h>
#define READ_SIZE (256)
#define NB_PAGES (128)
@Zibri
Zibri / reset.css
Created November 27, 2021 14:38
CSS Reset
/*
1. Use a more-intuitive box-sizing model.
*/
*, *::before, *::after {
box-sizing: border-box;
}
/*
2. Remove default margin
*/
* {
@Zibri
Zibri / ubuntu_bluez_midi.sh
Created March 6, 2022 12:08
Bash script to recompile bluez on Linux
#!/bin/bash
#
# Bash script to recompile bluez on Linux
# Tested on Ubuntu 20.04
sudo apt-get update
cd /tmp
sudo apt-get install -y libudev-dev libical-dev libreadline-dev libdbus-1-dev libasound2-dev build-essential
apt-get build-dep bluez
apt-get source bluez
@Zibri
Zibri / paste_this_in_js_console.js
Last active April 19, 2022 23:59
Minimal javascript IRC client in console
function irc(nickname, server, chan, onmsg, onjoin) {
nickname = nickname || "nick_" + new Date().getTime().toString(36) + new Date().getMilliseconds().toString(36)
chan = chan || "Z" + new Date().getTime().toString(18) + Math.random().toString(36).substring(2)
server = server || "irc.unrealircd.org"
var init = 0
var ws = new WebSocket("wss://" + server);
var s = (c,l)=>setTimeout(console.log.bind(this, "%c%s", "font-size: 14px; color:" + c, new Date().toLocaleString("it") + ": " + l))
ws.onmessage = m=>{
if (m.data.indexOf("PING") == 0)
ws.send(m.data.replace("PI", "PO"));
@Zibri
Zibri / crt.css
Last active April 2, 2023 13:02
CRT effect with flickering scanlines and RGB grid.
// CRT effect with flickering scanlines and RGB grid.
// By zibri@zibri.org
// <html class="crt"> </html>
@keyframes flicker {
50% {
top: -3px
}
}
@Zibri
Zibri / sendRawEth.c
Created August 22, 2023 15:43 — forked from austinmarton/sendRawEth.c
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>