From 821f9bbf5c5d8e77da2a59a27e632240c5c0cde4 Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Mon, 19 Dec 2016 16:19:11 +0100 Subject: [PATCH] Fixed code blocks --- .../contents.lr | 12 +++++++----- .../contents.lr | 4 ++-- .../contents.lr | 10 +++++----- .../contents.lr | 10 +++++----- .../contents.lr | 4 ++-- .../contents.lr | 8 ++++---- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/content/blog/2012-12-20-howto-os-x-screenshots-without-shadows/contents.lr b/content/blog/2012-12-20-howto-os-x-screenshots-without-shadows/contents.lr index 5121888..23e8d83 100644 --- a/content/blog/2012-12-20-howto-os-x-screenshots-without-shadows/contents.lr +++ b/content/blog/2012-12-20-howto-os-x-screenshots-without-shadows/contents.lr @@ -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_ 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: -``` +``` text 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 shadow: -``` +``` text screencapture -i -o filename.png ``` A more complete one that saves the screenshot on the desktop with the datetime as filename: - -``` + +``` text screencapture -i -o ~/Desktop/screenshot_`date +%Y%m%d_%H%M%S`.png ``` diff --git a/content/blog/2013-02-27-server-going-slow-after-iptables-configuration-try/contents.lr b/content/blog/2013-02-27-server-going-slow-after-iptables-configuration-try/contents.lr index 1c23fe7..0ebe8c7 100644 --- a/content/blog/2013-02-27-server-going-slow-after-iptables-configuration-try/contents.lr +++ b/content/blog/2013-02-27-server-going-slow-after-iptables-configuration-try/contents.lr @@ -13,14 +13,14 @@ lot of things, these two solved the issue: ## Enable unilimited traffic on your loopback interface -``` +``` text iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT ``` ## Enable traffic for connections started by your server -``` +``` text iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT ``` diff --git a/content/blog/2013-07-04-extracting-data-from-obfuscated-java-code/contents.lr b/content/blog/2013-07-04-extracting-data-from-obfuscated-java-code/contents.lr index a86254b..aeaef7f 100644 --- a/content/blog/2013-07-04-extracting-data-from-obfuscated-java-code/contents.lr +++ b/content/blog/2013-07-04-extracting-data-from-obfuscated-java-code/contents.lr @@ -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 java compiled files, you can just `tar -xf` or `unzip` it into a folder: -``` - unzip -qq minecraft.jar -d ./jarfile +``` text +unzip -qq minecraft.jar -d ./jarfile ``` 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 files and decompile them into .java source code: -``` +``` text 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 this test, I used the string "diamond": -``` +``` text $ grep diamond ./classes/* ./classes/bfp.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 will need to use more than one keyword to look for data. -``` +``` text $ grep flintAndSteel ./classes/* ./classes/xn.java: public static xn k = (new xh(3)).b("flintAndSteel"); ``` diff --git a/content/blog/2013-07-09-how-install-and-configure-yubikey-pam-module-archlinux/contents.lr b/content/blog/2013-07-09-how-install-and-configure-yubikey-pam-module-archlinux/contents.lr index 5e85115..08bdbd7 100644 --- a/content/blog/2013-07-09-how-install-and-configure-yubikey-pam-module-archlinux/contents.lr +++ b/content/blog/2013-07-09-how-install-and-configure-yubikey-pam-module-archlinux/contents.lr @@ -30,7 +30,7 @@ installation. 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 $ tar xvzf libyubikey.tar.gz $ 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: -``` +``` text 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 `$HOME/.yubico/authorized_yubikeys` with the following contents: -``` +``` text :[::[::[: login your_username_here diff --git a/content/blog/2015-05-04-amazon-ec2-no-space-left-device/contents.lr b/content/blog/2015-05-04-amazon-ec2-no-space-left-device/contents.lr index bf0b6ca..7877db0 100644 --- a/content/blog/2015-05-04-amazon-ec2-no-space-left-device/contents.lr +++ b/content/blog/2015-05-04-amazon-ec2-no-space-left-device/contents.lr @@ -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 terminal: -``` +``` text 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 was right. -``` +``` text fmartingr@pre-production:~$ df -h Filesystem Size Used Avail Use% Mounted on /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 [inode](http://www.wikiwand.com/en/Inode). -``` +``` text fmartingr@pre-production:~$ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /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 this command: -``` +``` text find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -nr ```