Skip to content

Instantly share code, notes, and snippets.

View seqizz's full-sized avatar
💩
why the heck github has status support

Gürkan seqizz

💩
why the heck github has status support
View GitHub Profile
@seqizz
seqizz / psitool_cpu.py
Last active May 11, 2020 19:03
Linux CPU PSI helper
#!/usr/bin/env python3
from hashlib import sha256
from pickle import load, dump
from socket import gethostname
from time import time
def current_psi_dict():
with open('/proc/pressure/cpu', 'r') as psifile:
@seqizz
seqizz / personal_tst.css
Created May 4, 2018 09:51
My TST config
/* Adjust style for tab that has sound playing. */
.tab.sound-playing .label:before {
content: " 🔊 ";
}
/* Show title of unread tabs with red and italic font */
/*
.tab.unread .label {
color: red !important;
font-style: italic !important;
@seqizz
seqizz / funanswers.md
Last active January 23, 2023 20:37
Answer to fun questions

This is just my answer template for "Fun questions" section on sysadmin interview repo: https://github.com/chassing/linux-sysadmin-interview-questions#fun

A careless sysadmin executes the following command: chmod 444 /bin/chmod - what do you do to fix this?

First of all, I'd get the root privileges from that person away. As answer, I have 2 solutions:

  1. I'd create a dumb FS (like fat) on a loopback device and copy this file to there, since every file will have executable rights there.
  2. There is no problem, system is running without problems, so no need to fix.

I've lost my root password, what can I do?

@seqizz
seqizz / userChrome.css
Last active December 19, 2017 10:53
Delayed animation for sidebar and compact "tree style tab" extension tricks
#TabsToolbar {
visibility: collapse !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
display: none;
}
/*
#sidebar-box, #sidebar-box *{ max-width:5em; min-width:50px;}
#sidebar-box:hover, #sidebar-box:hover *{ max-width:none!important;}
@seqizz
seqizz / trace.sh
Created October 1, 2016 10:28
kde error trace (blog
cat dafuqtrace.out | grep pam.d
stat("/etc/pam.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/etc/pam.d/kde", O_RDONLY) = 3
open("/etc/pam.d/other", O_RDONLY) = 3
read(3, "auth required\tpam_deny.so\n"..., 4096) = 128
@seqizz
seqizz / tunnel.sh
Created October 1, 2016 10:27
SSH tünel (blog)
ssh -v -C2qTnN -D 8080 -p22 kullanıcıadı@ipadresi
@seqizz
seqizz / hash.sh
Last active October 1, 2016 10:25
MD5 hash (blog)
#!/bin/ksh
ostype=`uname`
if [[ $ostype = "HP-UX" ]] ;then
echo "something" | openssl dgst -md5
elif [[ $ostype = "SunOS" ]]; then
echo "something" | digest -a md5
elif [[ $ostype = "Linux" ]]; then
echo "something" | md5sum | awk '{print $1}'
elif [[ $ostype = "AIX" ]]; then
@seqizz
seqizz / hpsum -h
Last active October 1, 2016 10:25
HPSUM help (blog)
[root@localhost]$ hpsum -h
HP Smart Update Manager 7.4.0
For CLI (legacy command) information:
hpsum --s [--help | --h]
To start HP SUM in interactive GUI mode:
hpsum [--port <#>] [--ssl_port <#>] [--open_firewall] [--overridedb]
To use interactive console mode:
hpsum <console_command> [--help | --h]
Supported console commands:
abort
@seqizz
seqizz / iloreport.py
Last active October 12, 2016 14:53
HP ILO reporting script (blog)
#!/usr/bin/env python3
# gurkan,2016
# license info: http://www.wtfpl.net/
username = "ilo-username"
password = 'ilo-password'
import hpilo
@seqizz
seqizz / yeah.sh
Last active January 3, 2016 09:15
if [[ $? == 0 ]]; then
#!/bin/bash
# mfw script succeeded: https://asciinema.org/a/af1i594gccusvzk6oqbyugkvl
function animate {
echo -ne " $1\033[0K\r"
sleep 1
}
echo