Fixed code blocks

This commit is contained in:
Felipe M 2016-12-19 16:19:11 +01:00
parent 899c58918a
commit 821f9bbf5c
6 changed files with 25 additions and 23 deletions

View file

@ -16,11 +16,13 @@ there could be some `defaults` option for the same purpose. And it is!
With this two commands you can use the normal keybinds to do _shadowless_ With this two commands you can use the normal keybinds to do _shadowless_
screenshots: screenshots:
`defaults write com.apple.screencapture disable-shadow -bool true killall SystemUIServer` ``` text
defaults write com.apple.screencapture disable-shadow -bool true killall SystemUIServer`
```
To revert to the original status: To revert to the original status:
``` ``` text
defaults write com.apple.screencapture disable-shadow -bool false killall SystemUIServer defaults write com.apple.screencapture disable-shadow -bool false killall SystemUIServer
``` ```
@ -37,14 +39,14 @@ OS X provides us with the `screencapture` command, so we can hack around and
build our own scripts. A simple one that allows interactive capture without build our own scripts. A simple one that allows interactive capture without
shadow: shadow:
``` ``` text
screencapture -i -o filename.png screencapture -i -o filename.png
``` ```
A more complete one that saves the screenshot on the desktop with the datetime A more complete one that saves the screenshot on the desktop with the datetime
as filename: as filename:
``` ``` text
screencapture -i -o ~/Desktop/screenshot_`date +%Y%m%d_%H%M%S`.png screencapture -i -o ~/Desktop/screenshot_`date +%Y%m%d_%H%M%S`.png
``` ```

View file

@ -13,14 +13,14 @@ lot of things, these two solved the issue:
## Enable unilimited traffic on your loopback interface ## Enable unilimited traffic on your loopback interface
``` ``` text
iptables -A INPUT -i lo -j ACCEPT iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT
``` ```
## Enable traffic for connections started by your server ## Enable traffic for connections started by your server
``` ``` text
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
``` ```

View file

@ -25,8 +25,8 @@ _classfiles_? That would be awesome! *Spoiler alert* I did it.
First of all, you have a _minecraft.jar_ file that it's just a packaged set of First of all, you have a _minecraft.jar_ file that it's just a packaged set of
java compiled files, you can just `tar -xf` or `unzip` it into a folder: java compiled files, you can just `tar -xf` or `unzip` it into a folder:
``` ``` text
unzip -qq minecraft.jar -d ./jarfile unzip -qq minecraft.jar -d ./jarfile
``` ```
With this we now have a folder called _jarfile__ _filled with all the jar With this we now have a folder called _jarfile__ _filled with all the jar
@ -36,7 +36,7 @@ source. For this purpose we're going to use [JAD](http://varaneckas.com/jad/),
a java decompiler. With a single line of _bash_ we can look for all the .class a java decompiler. With a single line of _bash_ we can look for all the .class
files and decompile them into .java source code: files and decompile them into .java source code:
``` ``` text
ls ./jarfile/*.class | xargs -n1 jad -sjava -dclasses &> /dev/null ls ./jarfile/*.class | xargs -n1 jad -sjava -dclasses &> /dev/null
``` ```
@ -72,7 +72,7 @@ source, there must be some kind of string I can use to search all the files
and get only the ones that contains the pieces of information I look for. For and get only the ones that contains the pieces of information I look for. For
this test, I used the string "diamond": this test, I used the string "diamond":
``` ``` text
$ grep diamond ./classes/* $ grep diamond ./classes/*
./classes/bfp.java: "cloth", "chain", "iron", "diamond", "gold" ./classes/bfp.java: "cloth", "chain", "iron", "diamond", "gold"
./classes/bge.java: "cloth", "chain", "iron", "diamond", "gold" ./classes/bge.java: "cloth", "chain", "iron", "diamond", "gold"
@ -88,7 +88,7 @@ code and we now to filter even more, looking around some files I selected
another keyword: _flintAndSteel_, works great here, but in a real example you another keyword: _flintAndSteel_, works great here, but in a real example you
will need to use more than one keyword to look for data. will need to use more than one keyword to look for data.
``` ``` text
$ grep flintAndSteel ./classes/* $ grep flintAndSteel ./classes/*
./classes/xn.java: public static xn k = (new xh(3)).b("flintAndSteel"); ./classes/xn.java: public static xn k = (new xh(3)).b("flintAndSteel");
``` ```

View file

@ -30,7 +30,7 @@ installation.
You can install that with your favourite AUR helper or using `makepkg`: You can install that with your favourite AUR helper or using `makepkg`:
``` ``` text
$ curl -O https://aur.archlinux.org/packages/li/libyubikey/libyubikey.tar.gz $ curl -O https://aur.archlinux.org/packages/li/libyubikey/libyubikey.tar.gz
$ tar xvzf libyubikey.tar.gz $ tar xvzf libyubikey.tar.gz
$ cd libyubikey $ cd libyubikey
@ -48,7 +48,7 @@ page](https://wiki.archlinux.org/index.php/AUR#Installing_packages).
Edit `/etc/pam.d/sshd` and add on top on the rest of the auth modules: Edit `/etc/pam.d/sshd` and add on top on the rest of the auth modules:
``` ``` text
auth sufficient pam_yubico.so id=XXXX key=XXXX auth sufficient pam_yubico.so id=XXXX key=XXXX
``` ```
@ -63,7 +63,7 @@ If your server have multiple users this is the easiest method to let them
configure their yubikeys. You just need to create the file configure their yubikeys. You just need to create the file
`$HOME/.yubico/authorized_yubikeys` with the following contents: `$HOME/.yubico/authorized_yubikeys` with the following contents:
``` ``` text
<username>:<Yubikey token ID 1>[:<Yubikey token ID 2][:...] <username>:<Yubikey token ID 1>[:<Yubikey token ID 2][:...]
``` ```
@ -77,7 +77,7 @@ Restart your ssh server to apply the changes.
Create a file on `/etc/yubikey_mappings` that will contain all your users and Create a file on `/etc/yubikey_mappings` that will contain all your users and
their respective yubikey token identifiers, like this: their respective yubikey token identifiers, like this:
``` ``` text
<first username>:<Yubikey token ID 1>[:<Yubikey token ID 2][:...] <first username>:<Yubikey token ID 1>[:<Yubikey token ID 2][:...]
<second username>:<Yubikey token ID 3>[:<Yubikey token ID 4][:...] <second username>:<Yubikey token ID 3>[:<Yubikey token ID 4][:...]
``` ```
@ -85,7 +85,7 @@ their respective yubikey token identifiers, like this:
For this to work, you need to specify this file to the pam module `authfile` For this to work, you need to specify this file to the pam module `authfile`
parameter: parameter:
``` ``` text
auth sufficient pam_yubico.so id=XXXX key=XXXX authfile=/etc/yubikey_mappings auth sufficient pam_yubico.so id=XXXX key=XXXX authfile=/etc/yubikey_mappings
``` ```

View file

@ -16,7 +16,7 @@ Basically you need to download it's shell script to manage steam apps, take
special attention to the lib32 section if you're running the server in a 64bit special attention to the lib32 section if you're running the server in a 64bit
machine. machine.
``` ``` text
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz wget http://media.steampowered.com/client/steamcmd_linux.tar.gz
tar xzf steamcmd_linux.tar.gz tar xzf steamcmd_linux.tar.gz
``` ```
@ -27,7 +27,7 @@ You will need to login with your steam username here to download/update
starbound. Your account** is not needed** to keep the server running. starbound. Your account** is not needed** to keep the server running.
``` ``` text
./steamcmd.sh ./steamcmd.sh
# Steam updating and validating stuff # Steam updating and validating stuff
Steam> login your_username_here Steam> login your_username_here

View file

@ -7,7 +7,7 @@ So a funny thing happened today at out pre-production environment. I was
performing our pre-big-PR deployment when a beautiful error was shown in my performing our pre-big-PR deployment when a beautiful error was shown in my
terminal: terminal:
``` ``` text
cannot create X: No space left on device cannot create X: No space left on device
``` ```
@ -16,7 +16,7 @@ lot of bytes for us to play with but having the storage already full with our
database and other services outside this machine just wasn't possible. And I database and other services outside this machine just wasn't possible. And I
was right. was right.
``` ``` text
fmartingr@pre-production:~$ df -h fmartingr@pre-production:~$ df -h
Filesystem Size Used Avail Use% Mounted on Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 59G 37G 21G 65% / /dev/xvda1 59G 37G 21G 65% /
@ -32,7 +32,7 @@ What?! Now I sure don't understand a thing. I was laughing hysterically when
my brain just started working as I remembered an old friend: the my brain just started working as I remembered an old friend: the
[inode](http://www.wikiwand.com/en/Inode). [inode](http://www.wikiwand.com/en/Inode).
``` ``` text
fmartingr@pre-production:~$ df -i fmartingr@pre-production:~$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/xvda1 3932160 3932160 0 100% / /dev/xvda1 3932160 3932160 0 100% /
@ -53,7 +53,7 @@ just deletes builds older than two weeks and our poor thing was happy again.
To search which folder of your server is eating the inode limit, you can run To search which folder of your server is eating the inode limit, you can run
this command: this command:
``` ``` text
find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -nr find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -nr
``` ```