From 9c2ec8241e81155e9070ee0f12f60e318d2b63be Mon Sep 17 00:00:00 2001 From: Felipe Martin Date: Sun, 29 Nov 2020 21:29:10 +0100 Subject: [PATCH] Moved blog templates to default paths --- .../contents.lr | 28 ++-- .../contents.lr | 2 +- .../contents.lr | 2 +- content/blog/2012-12-31-2013/contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 18 +-- .../contents.lr | 8 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 134 +++++++++--------- .../contents.lr | 20 +-- .../contents.lr | 4 +- .../contents.lr | 28 ++-- .../contents.lr | 2 +- .../contents.lr | 40 +++--- .../contents.lr | 8 +- .../contents.lr | 10 +- .../blog/2015-07-18-piweek-viii/contents.lr | 2 +- .../contents.lr | 2 +- .../2015-07-23-emacs-day-zero/contents.lr | 2 +- .../contents.lr | 2 +- .../blog/2015-08-04-tmux-basics/contents.lr | 4 +- .../contents.lr | 2 +- .../blog/2016-04-08-2016-updates/contents.lr | 14 +- .../2016-04-11-penguin-trials/contents.lr | 2 +- .../contents.lr | 2 +- content/blog/2016-12-21-new-site/contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- .../contents.lr | 2 +- content/blog/2020-01-01-2019/contents.lr | 2 +- content/blog/2020-01-31-january/contents.lr | 2 +- content/blog/2020-02-29-february/contents.lr | 2 +- content/blog/2020-04-01-march/contents.lr | 2 +- content/blog/2020-05-01-april/contents.lr | 2 +- content/blog/2020-06-01-may/contents.lr | 2 +- content/blog/2020-07-02-june/contents.lr | 2 +- content/blog/2020-08-02-july/contents.lr | 2 +- content/blog/2020-09-01-august/contents.lr | 2 +- content/blog/2020-10-01-september/contents.lr | 2 +- .../contents.lr | 2 +- content/blog/2020-11-01-october/contents.lr | 2 +- .../contents.lr | 2 +- content/blog/2020-12-01-november/contents.lr | 2 +- content/blog/contents.lr | 3 +- templates/{blog/list.html => blog-list.html} | 0 templates/{blog/post.html => blog-post.html} | 0 55 files changed, 200 insertions(+), 199 deletions(-) rename templates/{blog/list.html => blog-list.html} (100%) rename templates/{blog/post.html => blog-post.html} (100%) diff --git a/content/blog/2012-11-23-amazon-s3-bucket-public-read-policy/contents.lr b/content/blog/2012-11-23-amazon-s3-bucket-public-read-policy/contents.lr index 31cfafc..4f7fbe0 100644 --- a/content/blog/2012-11-23-amazon-s3-bucket-public-read-policy/contents.lr +++ b/content/blog/2012-11-23-amazon-s3-bucket-public-read-policy/contents.lr @@ -15,19 +15,19 @@ properties for the entire bucket. For making a read-only public bucket you need this: ``` js -{ - "Version": "2008-10-17", - "Statement": [{ - "Sid": "AllowPublicRead", - "Effect": "Allow", - "Principal": { - "AWS": "*" - }, - "Action": ["s3:GetObject"], - "Resource": ["arn:aws:s3:::/*"] - }] -} -``` +{ + "Version": "2008-10-17", + "Statement": [{ + "Sid": "AllowPublicRead", + "Effect": "Allow", + "Principal": { + "AWS": "*" + }, + "Action": ["s3:GetObject"], + "Resource": ["arn:aws:s3:::/*"] + }] +} +``` Replace <bucket name> for yours and apply changes. With this the entire bucket will be publicy accesible, but if you want to be more restrictive, you @@ -42,4 +42,4 @@ Hope this helps. --- pub_date: 2012-11-23 --- -_template: blog/post.html +_template: blog-post.html 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 23e8d83..5149c08 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 @@ -59,4 +59,4 @@ Hope this helps! --- pub_date: 2012-12-20 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2012-12-21-my-sublimetext-2-workspace/contents.lr b/content/blog/2012-12-21-my-sublimetext-2-workspace/contents.lr index d16cb3a..eb53488 100644 --- a/content/blog/2012-12-21-my-sublimetext-2-workspace/contents.lr +++ b/content/blog/2012-12-21-my-sublimetext-2-workspace/contents.lr @@ -71,4 +71,4 @@ plugins not listed here? Tell me! --- pub_date: 2012-12-21 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2012-12-31-2013/contents.lr b/content/blog/2012-12-31-2013/contents.lr index 7d34df0..c7ff5f6 100644 --- a/content/blog/2012-12-31-2013/contents.lr +++ b/content/blog/2012-12-31-2013/contents.lr @@ -28,4 +28,4 @@ Happy new year! --- pub_date: 2012-12-31 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-01-12-weekly-project-status-dropping-projects-hard/contents.lr b/content/blog/2013-01-12-weekly-project-status-dropping-projects-hard/contents.lr index 1bc2754..a1d7226 100644 --- a/content/blog/2013-01-12-weekly-project-status-dropping-projects-hard/contents.lr +++ b/content/blog/2013-01-12-weekly-project-status-dropping-projects-hard/contents.lr @@ -115,4 +115,4 @@ tweet, mail or shout at me! --- pub_date: 2013-01-12 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-01-14-tweeria-mmorpg-people-without-time-can-play/contents.lr b/content/blog/2013-01-14-tweeria-mmorpg-people-without-time-can-play/contents.lr index 0538388..7fcb02d 100644 --- a/content/blog/2013-01-14-tweeria-mmorpg-people-without-time-can-play/contents.lr +++ b/content/blog/2013-01-14-tweeria-mmorpg-people-without-time-can-play/contents.lr @@ -63,4 +63,4 @@ achievement! :D --- pub_date: 2013-01-14 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-01-20-manga-recommendation-kamisama-no-iutoori-fujimura-akeji/contents.lr b/content/blog/2013-01-20-manga-recommendation-kamisama-no-iutoori-fujimura-akeji/contents.lr index 1290067..b67a090 100644 --- a/content/blog/2013-01-20-manga-recommendation-kamisama-no-iutoori-fujimura-akeji/contents.lr +++ b/content/blog/2013-01-20-manga-recommendation-kamisama-no-iutoori-fujimura-akeji/contents.lr @@ -30,4 +30,4 @@ recommendation! --- pub_date: 2013-01-20 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-02-23-manga-recommendation-psyren/contents.lr b/content/blog/2013-02-23-manga-recommendation-psyren/contents.lr index 2ac7a68..82b12cf 100644 --- a/content/blog/2013-02-23-manga-recommendation-psyren/contents.lr +++ b/content/blog/2013-02-23-manga-recommendation-psyren/contents.lr @@ -22,4 +22,4 @@ save the world from becoming Psyren. --- pub_date: 2013-02-23 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-02-23-where-buy-warcraft-books-ordered-storyline/contents.lr b/content/blog/2013-02-23-where-buy-warcraft-books-ordered-storyline/contents.lr index 7efa609..2f3c1a2 100644 --- a/content/blog/2013-02-23-where-buy-warcraft-books-ordered-storyline/contents.lr +++ b/content/blog/2013-02-23-where-buy-warcraft-books-ordered-storyline/contents.lr @@ -300,4 +300,4 @@ More info on [WowWiki](http://www.wowwiki.com/Story_guide). --- pub_date: 2013-02-23 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-02-24-fringe-series-finale-my-oppinion/contents.lr b/content/blog/2013-02-24-fringe-series-finale-my-oppinion/contents.lr index 0a45d1c..f237502 100644 --- a/content/blog/2013-02-24-fringe-series-finale-my-oppinion/contents.lr +++ b/content/blog/2013-02-24-fringe-series-finale-my-oppinion/contents.lr @@ -16,7 +16,7 @@ don't know another reason to kill the show this way. From now on I'm talking only about the fifth season, as should be the more important and the one all of you -and myself- have fresh. - * The most stupid thing I remember: The tapes with the plan to get rid of the observers. + * The most stupid thing I remember: The tapes with the plan to get rid of the observers. Walter had a plan to defeat the observers, a plan that he never tell anyone until is destroyed from his mind by an observer. But, hey! He must have recorded the plan or something. I mean, he is a very smart one. He did. He @@ -25,18 +25,18 @@ swim accross a sea of _amber_ to find another eight tapes with the details. OH HOW SMART IS THAT! Just a stupid reason to keep characters busy. Without this the entire fifth season is done in two-three chapters. - * The observers powers. + * The observers powers. So, I can read minds and predict -in some way- the future. How can SOMEONE DEFEAT YOU IF YOU CAN PREDICT WHAT ARE THEY GOING TO DO. And more, you SAW in Walter's mind what the plan was. The observers boss is just… asshole. - * The plan. + * The plan. Tons of VHS tapes with a specific plan of how to build a machine to generate a wormhole, but in the last moment, hey! But the observers generate wormholes for their supplies, let's use that! Let's put humanity's hope on a last moment change! :D - * Olivia's powers. + * Olivia's powers. You used your last _cortexiphan_ -or however it's written- on revive yourself from a headshot (LOL), then you get injected fours times, each for every dimension swap you have to do. Despite the fact that just this sucks, there's @@ -45,22 +45,22 @@ is not that she have the powers _active_, but also she knows how to swap dimensions on her own will. Fascinating. Also, from this point Olivia don't need fear to use her powers. - * The observers chip. + * The observers chip. Peter removes a chip from a observer and the observer die. Removes it from himself and nothing happen. And I'm not talking about how deep the chip was jumping insinde the brain when Walter did the tests… just WTF, die already. - * Gun's agains the observers. + * Gun's agains the observers. This is just a little thing: in _our_ universe, Bell design some improved guns -that apparently only the rebels have 21 years in the future…\- that shoots faster to deal with the observers. When Olivia travels to the alternative universe, they don't have that guns but can kill observers without a problem. - * Time travel: + * Time travel: Apparently there's only one shot for a single one to time-travel: September takes it. But when he's killed nothing prevents Walter for time traveling. - * Olivia vs. Observer Boss. + * Olivia vs. Observer Boss. Apparently the energy needed to move a truck with the cortexiphan powers is the electricity of the entire New York. That's efficient use of energy. @@ -71,4 +71,4 @@ more than enough here. --- pub_date: 2013-02-24 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-02-27-manga-recommendation-enigma/contents.lr b/content/blog/2013-02-27-manga-recommendation-enigma/contents.lr index 8b3ff08..b8c5388 100644 --- a/content/blog/2013-02-27-manga-recommendation-enigma/contents.lr +++ b/content/blog/2013-02-27-manga-recommendation-enigma/contents.lr @@ -12,13 +12,13 @@ written out on his "Dream Diary". With this ability, Sumio helps out people in trouble before anything bad happens, until one day when his peaceful life completely changes. -**Volumes**: 7 -**Chapters**: 56 (finished) -**Genre**: Adventure, Mystery, School, Shounen, Supernatural +**Volumes**: 7 +**Chapters**: 56 (finished) +**Genre**: Adventure, Mystery, School, Shounen, Supernatural **Story/Art**: Sakaki, Kenji --- pub_date: 2013-02-27 --- -_template: blog/post.html +_template: blog-post.html 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 0ebe8c7..a00ea36 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 @@ -28,4 +28,4 @@ Hope this solves your issue as it did with mine. --- pub_date: 2013-02-27 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-06-24-zombiepress-is-here/contents.lr b/content/blog/2013-06-24-zombiepress-is-here/contents.lr index ed88505..3c360f2 100644 --- a/content/blog/2013-06-24-zombiepress-is-here/contents.lr +++ b/content/blog/2013-06-24-zombiepress-is-here/contents.lr @@ -17,4 +17,4 @@ easy to use (in my oppinion): --- pub_date: 2013-06-24 --- -_template: blog/post.html +_template: blog-post.html diff --git a/content/blog/2013-07-01-django-stampu-static-sites-with-django/contents.lr b/content/blog/2013-07-01-django-stampu-static-sites-with-django/contents.lr index d0f935b..540924a 100644 --- a/content/blog/2013-07-01-django-stampu-static-sites-with-django/contents.lr +++ b/content/blog/2013-07-01-django-stampu-static-sites-with-django/contents.lr @@ -43,4 +43,4 @@ github](https://github.com/fmartingr/django-stampu). --- pub_date: 2013-07-01 --- -_template: blog/post.html +_template: blog-post.html 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 aeaef7f..7c44109 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,7 +25,7 @@ _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: -``` text +``` text unzip -qq minecraft.jar -d ./jarfile ``` @@ -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 +``` text ls ./jarfile/*.class | xargs -n1 jad -sjava -dclasses &> /dev/null ``` @@ -45,19 +45,19 @@ into a separate directory. But there's a lot of files! And also, when we open one... ``` java -public class aea extends aeb -{ - public aea() - { - } - - protected void a(long l, int i, int j, byte abyte0[], double d, - double d1, double d2) - { - a(l, i, j, abyte0, d, d1, d2, 1.0F + b.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D); - } - // ... -} +public class aea extends aeb +{ + public aea() + { + } + + protected void a(long l, int i, int j, byte abyte0[], double d, + double d1, double d2) + { + a(l, i, j, abyte0, d, d1, d2, 1.0F + b.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D); + } + // ... +} ``` Look at that beautiful obfuscated piece of code! This is getting more @@ -73,12 +73,12 @@ 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" -./classes/kd.java: w = (new kc(17, "diamonds", -1, 5, xn.p, k)).c(); -./classes/rf.java: null, "mob/horse/armor_metal.png", "mob/horse/armor_gold.png", "mob/horse/armor_diamond.png" -./classes/xn.java: p = (new xn(8)).b("diamond").a(wh.l); +$ grep diamond ./classes/* +./classes/bfp.java: "cloth", "chain", "iron", "diamond", "gold" +./classes/bge.java: "cloth", "chain", "iron", "diamond", "gold" +./classes/kd.java: w = (new kc(17, "diamonds", -1, 5, xn.p, k)).c(); +./classes/rf.java: null, "mob/horse/armor_metal.png", "mob/horse/armor_gold.png", "mob/horse/armor_diamond.png" +./classes/xn.java: p = (new xn(8)).b("diamond").a(wh.l); ./classes/xn.java: cg = (new xn(163)).b("horsearmordiamond").d(1).a(wh.f); ``` @@ -89,7 +89,7 @@ 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/* +$ grep flintAndSteel ./classes/* ./classes/xn.java: public static xn k = (new xh(3)).b("flintAndSteel"); ``` @@ -110,15 +110,15 @@ After some tests, I decided to _convert_ the java code into python. For that, I used simple find and match to get the lines that had the definitions I wanted, something line this: -``` java -// As a first simple filter, we only use a code line if a double quote is found on it. -// Then, regex: /new (?P[a-z]{2}\((?P[1-9]{1,3}).*\"(?P\w+)\"\))/ -// ... -T = (new xm(38, xo.e)).b("hoeGold"); -U = (new yi(39, aqh.aD.cE, aqh.aE.cE)).b("seeds"); -V = (new xn(40)).b("wheat").a(wh.l); -X = (vr)(new vr(42, vt.a, 0, 0)).b("helmetCloth"); -Y = (vr)(new vr(43, vt.a, 0, 1)).b("chestplateCloth"); +``` java +// As a first simple filter, we only use a code line if a double quote is found on it. +// Then, regex: /new (?P[a-z]{2}\((?P[1-9]{1,3}).*\"(?P\w+)\"\))/ +// ... +T = (new xm(38, xo.e)).b("hoeGold"); +U = (new yi(39, aqh.aD.cE, aqh.aE.cE)).b("seeds"); +V = (new xn(40)).b("wheat").a(wh.l); +X = (vr)(new vr(42, vt.a, 0, 0)).b("helmetCloth"); +Y = (vr)(new vr(43, vt.a, 0, 1)).b("chestplateCloth"); // ... ``` @@ -130,34 +130,34 @@ Since that java code is not python evaluable, just convert it: - Converted arguments to string. This can be improved a lot, leaving decimals, converting floats to python notation, detecting words for string conversion, etc. Since for now I am not using any of the extra parameters this works for me. - Be careful with reserved python names! (`and`, `all`, `abs`, ...) -``` python -// Java: U = (new yi(39, aqh.aD.cE, aqh.aE.cE)).b("seeds"); -yi("39", "aqh.ad.cE", "aqh.aE.cE").b("seeds") -// Java: bm = (new xi(109, 2, 0.3F, true)).a(mv.s.H, 30, 0, 0.3F).b("chickenRaw"); +``` python +// Java: U = (new yi(39, aqh.aD.cE, aqh.aE.cE)).b("seeds"); +yi("39", "aqh.ad.cE", "aqh.aE.cE").b("seeds") +// Java: bm = (new xi(109, 2, 0.3F, true)).a(mv.s.H, 30, 0, 0.3F).b("chickenRaw"); xi("109", "2", "0.3F", "true").a("mv.s.H", "30", "0", "0.3F").b("chickenRaw") ``` Now I defined an object to match with the java code definitions when evaluating: -``` python -class GameItem(object): - def __init__(self, game_id, *args): - self.id = int(game_id) - - def __str__(self, *args): - return "" % ( - self.id, - self.name - ) - - def method(self, *args): - if len(args) == 1 and isinstance(args[0], str): - "Sets the name" - self.name = args[0] - return self - - def __getattr__(self, *args): +``` python +class GameItem(object): + def __init__(self, game_id, *args): + self.id = int(game_id) + + def __str__(self, *args): + return "" % ( + self.id, + self.name + ) + + def method(self, *args): + if len(args) == 1 and isinstance(args[0], str): + "Sets the name" + self.name = args[0] + return self + + def __getattr__(self, *args): return self.method ``` @@ -171,19 +171,19 @@ the class name _<insert obfuscated class name here>_ is not defined. With that, we will declare that name as an instance of the GameItem class, so re-evaluating the code again will return a GameItem object: -``` python -try: - # Tries to evaluate the piece of code that we converted - obj = eval(item['code']) -except NameError as error: - # Class name do not exist! We need to define it. - # Extract class name from the error message - # Defined somewhere else: class_error_regex = re.compile('name \'(?P\w+)\' is not defined') - class_name = class_error_regex.search(error.__str__()).group('name') - # Define class name as instance of GameItem - setattr(sys.modules[__name__], class_name, type(class_name, (GameItem,), {})) - # Evaluate again to get the object - obj = eval(item['code']) +``` python +try: + # Tries to evaluate the piece of code that we converted + obj = eval(item['code']) +except NameError as error: + # Class name do not exist! We need to define it. + # Extract class name from the error message + # Defined somewhere else: class_error_regex = re.compile('name \'(?P\w+)\' is not defined') + class_name = class_error_regex.search(error.__str__()).group('name') + # Define class name as instance of GameItem + setattr(sys.modules[__name__], class_name, type(class_name, (GameItem,), {})) + # Evaluate again to get the object + obj = eval(item['code']) ``` And with this, getting data from source code was possible and really helpful. @@ -210,4 +210,4 @@ github. --- pub_date: 2013-07-04 --- -_template: blog/post.html +_template: blog-post.html 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 08bdbd7..eaf91dc 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,14 +30,14 @@ 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 -$ makepkg PKGBUILD -# ... -$ sudo pacman -U libyubikey-1.10-2-x86_64.pkg.tar.xz -``` +``` text +$ curl -O https://aur.archlinux.org/packages/li/libyubikey/libyubikey.tar.gz +$ tar xvzf libyubikey.tar.gz +$ cd libyubikey +$ makepkg PKGBUILD +# ... +$ sudo pacman -U libyubikey-1.10-2-x86_64.pkg.tar.xz +``` Repeat that step for all the packages, in order: _libyubikey_, _yubico-c- client_, _yubikey-personalization_ and _yubico-pam_. If you have trouble @@ -78,7 +78,7 @@ Create a file on `/etc/yubikey_mappings` that will contain all your users and their respective yubikey token identifiers, like this: ``` text -:[::[::[: