Skip to content

Instantly share code, notes, and snippets.

View P4z's full-sized avatar

Remik P4z

View GitHub Profile
@P4z
P4z / motd.tcl
Created April 22, 2016 21:37
/etc/motd.tcl
#!/usr/bin/env tclsh
# MOTD script original? / mod mewbies.com / mod P4
# http://www.mewbies.com/how_to_customize_your_console_login_message_tutorial.htm
# * Variables
set var(user) $env(USER)
set var(path) $env(PWD)
set var(home) $env(HOME)
# * Calculate current system uptime
@P4z
P4z / diamond-0.1.aamap-1.xml
Created February 8, 2022 23:41
Armagetron Advanced aka Retrocycles styball mode diamond map.
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE Resource SYSTEM "sty.dtd">
<Resource type="aamap" name="diamond" version="0.1" author="P4" category="sty">
<Map version="0.2.8">
<Settings>
<Setting name="BALL_TEAM_MODE" value="0" />
</Settings>
<World>
<Field>
<Axes number="12"/>
@P4z
P4z / sysctl.conf
Created August 20, 2019 15:01 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@P4z
P4z / zte.reroute-syslog.sh
Created August 15, 2019 09:31
My solution to prevent sending syslog messages to untrusted remote host for ZTE's 4G modems.
#!/bin/sh
/bin/netstat -rn | grep ^195.54.122.206 > /dev/null
if [[ $? -eq 1 ]] ; then /bin/iproute add 195.54.122.206/32 dev usb0; fi
@P4z
P4z / keybase.md
Created June 2, 2018 22:39
Keybase proof

Keybase proof

I hereby claim:

  • I am P4z on github.
  • I am p4 (https://keybase.io/p4) on keybase.
  • I have a public key whose fingerprint is 939C 7C85 E24C 5B59 8A23 16D8 4544 9157 DE55 5D8E

To claim this, I am signing this object:

@P4z
P4z / fish_greeting.fish
Last active January 12, 2018 15:52
/etc/fish/fish_greeting
function fish_greeting
#/usr/games/fortune -s | /usr/games/cowsay -nfhead-in | /usr/games/lolcat
if test -x /etc/motd.tcl
/etc/motd.tcl
end
#/usr/bin/cal -B1 -A1 #| /usr/games/lolcat -ap .333 -d 2
end
@P4z
P4z / menu.js
Created June 23, 2017 06:08
/usr/zte_web/web/js/config/datacard/mf823/menu.js see https://blog.elevendroids.com/2014/06/changing-zte-mf823-4g-modem-ip-address/
define(function() {
var needLogin = false;
var menu = [
// level 1 menu
{
hash:'#login',
path:'login',
level:'1',
requireLogin:false,
checkSIMStatus:false
@P4z
P4z / fish_prompt.fish
Created April 22, 2016 21:24
/etc/fish/fish_prompt
function fish_prompt
#and set retc green; or set retc red
set lastexit $status
if test $lastexit = 0
set retc green
else
set retc red
end
tty|grep -q tty; and set tty tty; or set tty pts
set_color $retc