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 / 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 / split database dump
Last active August 1, 2021 03:04
Splitting --all-databases backup to per-database .sql files.
#!/usr/bin/perl -w
#
# Credit goes to: http://stackoverflow.com/questions/1876754/split-up-a-mysqldump-file-with-multiple-databases-by-database
#
# splitmysqldump - split mysqldump file into per-database dump files.
use strict;
use warnings;
my $dbfile;
@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 / dead.md
Last active March 26, 2018 10:31
Things to do to get fired (Linux version)
  • Set id:6:initdefault in /etc/inittab file
  • Write a script for system to randomly delete a single file without telling you every time you made a typographical error (wrong command).
  • chattr +i /etc/passwd or shadow, actually saw this on a server
  • add export PROMPT_COMMAND="cd" to profile file
  • chmod -x $(which chmod) or chmod -x $(readelf --header /bin/ls | grep interpreter | awk '{print $4}' | sed 's/]//')
  • upside-down-ternet
  • export EDITOR=$(which rm)

Sources as far as I remember: reddit, suicidelinux, HN

@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 / 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 / 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 / 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