This is not a particularly general tip or post, but Toni and I have been stuck with it for a few hours (day and 1/2, on and off).
Wifislax is this great auditing linux distro you can install and run from your usb.
But you have to know that even when burning it with either unetbootin or dd, the usb drive is not bootable. Don't know why, but it's not.
You have to mount the drive, and run a file called /boot/bootinst.sh .
Tada!.
Stupid, yes. But it took us hours to find out. It took more time to burn the iso than to do the actual 'auditing' job.
jueves, 19 de marzo de 2015
miércoles, 18 de marzo de 2015
Corgfiguring
Org is a beast, you probably already know it, whether you use it or not.
I've been using it on and off for a few years (at least 5), but never settling with it. Now it seems it's changing. But I digress.
Something that in the beginning was disturbing me was the many many ways you had to configure its behaviour. there were these #+FOO BAR , and these :PROPERTIES:, but you never knew which one to use, and in fact, I didn't even try to remember them.
But there's an absolutely coherent logic behind it. I'll try to explain.
If you use org as a way to manage your life, you can store different info in different files. One for calendar related things (that come from google calendar, or some rss feed), captures, captures from your browser, or from different areas of your life (work, home, fun). Some of them could live in the same file, but you can decide to use different files (One of my biggest questions to date is what should be a file, a heading, or a tag).
So it makes sense to be able to have global configurations for everything. For example
BUT! There might be a file, which you want different settings.
Put one of those in the beginning of your file, and this option will override the global variable.
AND! You may want one of the trees/subtrees in that file to be ruled by a different rule. Then is when you put a property in that given subtree. In this case, the property is called "VISIBILITY", and the allowed values are
So after all, it makes sense that things can be configured at so many levels.
Usually, there's a global var and a file setting for most of the options. The subtree level one is not so common, but you get the idea already.
I've been using it on and off for a few years (at least 5), but never settling with it. Now it seems it's changing. But I digress.
Something that in the beginning was disturbing me was the many many ways you had to configure its behaviour. there were these #+FOO BAR , and these :PROPERTIES:, but you never knew which one to use, and in fact, I didn't even try to remember them.
But there's an absolutely coherent logic behind it. I'll try to explain.
If you use org as a way to manage your life, you can store different info in different files. One for calendar related things (that come from google calendar, or some rss feed), captures, captures from your browser, or from different areas of your life (work, home, fun). Some of them could live in the same file, but you can decide to use different files (One of my biggest questions to date is what should be a file, a heading, or a tag).
So it makes sense to be able to have global configurations for everything. For example
org-startup-folded . this variable defines in which folding state will be your org files opened.BUT! There might be a file, which you want different settings.
#+STARTUP: overview
#+STARTUP: content
#+STARTUP: showall
#+STARTUP: showeverything
Put one of those in the beginning of your file, and this option will override the global variable.
AND! You may want one of the trees/subtrees in that file to be ruled by a different rule. Then is when you put a property in that given subtree. In this case, the property is called "VISIBILITY", and the allowed values are
folded, children, content, and
all. So after all, it makes sense that things can be configured at so many levels.
Usually, there's a global var and a file setting for most of the options. The subtree level one is not so common, but you get the idea already.
domingo, 23 de noviembre de 2014
Temporarily ignore people in IRC
I'm using irc more and more for my communication with others. And spending more time in IRC means that it makes more sense to optimize it. And also, erc is a good playground for us, elisp hackers :)
So when someone is bitching or saying nonsensic BS on some IRC channel (or slack, or hipchat, or anything that supports bitlbee), you can ignore him/her, but often you forget to unignore, and after a few hours they tell you something important and you just miss it. Not good.
So here's a timed ignore command for erc
Yes, some of you reading this will be the victims of this... :)
EDIT: This code needs to be in a file with lexical scope active. otherwise, use lexical-let instead of let
So when someone is bitching or saying nonsensic BS on some IRC channel (or slack, or hipchat, or anything that supports bitlbee), you can ignore him/her, but often you forget to unignore, and after a few hours they tell you something important and you just miss it. Not good.
So here's a timed ignore command for erc
(defun erc-cmd-TMPIG (&rest users) (let ((b (current-buffer))) (dolist (user users) (erc-process-input-line (format "/ignore %s" user))) (run-at-time (* 60 10) nil (lambda () (dolist (user users) (with-current-buffer b (erc-process-input-line (format "/unignore %s" user))))))))
Yes, some of you reading this will be the victims of this... :)
EDIT: This code needs to be in a file with lexical scope active. otherwise, use lexical-let instead of let
jueves, 13 de noviembre de 2014
Checking what's new with git
Short post today, but kinda useful IMHO.
From time to time I have to show my bosses what our team has done in the last period. We use 2 weeks as our sprint lenght (although we're not following scrum strictly).
Anyway, I was looking for a way to summarize the activities of the team, and instead of trying to remember, or having to write annotations for the next report, I just crafted this nifty little git log command which allows me to know which branches have been merged to master in the last 2 weeks.
So now, 5 minutes before the meeting I just run it and see what I have to debrief to my bosses (or other teams in the company).
Try it in your repos, and see how it works for you. For me it pretty much nails it.
From time to time I have to show my bosses what our team has done in the last period. We use 2 weeks as our sprint lenght (although we're not following scrum strictly).
Anyway, I was looking for a way to summarize the activities of the team, and instead of trying to remember, or having to write annotations for the next report, I just crafted this nifty little git log command which allows me to know which branches have been merged to master in the last 2 weeks.
So now, 5 minutes before the meeting I just run it and see what I have to debrief to my bosses (or other teams in the company).
git log --since=2.weeks.ago --merges --branches=master --first-parent --graph --pretty=oneline | sed -e 's/.* from/*/'
Try it in your repos, and see how it works for you. For me it pretty much nails it.
viernes, 31 de octubre de 2014
Poetry with factor.
I'm at the moment at the polyconf in Poznan. The average level of
the conference was very nice and High quality deliveries.
One of the activities of the conference was a programming poetry challenge.
Given that lately I've been doing some factor, and the huge
flexibility of it, I decided that this would be a competitive
advantage. And it certainly is. Basically because it uses no syntax
at all, you can just type a text, and make this text do nothing.
And the trick is to rewrite no-word to a nop. In the end I didn't
make it into the poetry contest (the price was a jetbrains license anyway).
Here's the code. Lovely.
the conference was very nice and High quality deliveries.
One of the activities of the conference was a programming poetry challenge.
Given that lately I've been doing some factor, and the huge
flexibility of it, I decided that this would be a competitive
advantage. And it certainly is. Basically because it uses no syntax
at all, you can just type a text, and make this text do nothing.
And the trick is to rewrite no-word to a nop. In the end I didn't
make it into the poetry contest (the price was a jetbrains license anyway).
Here's the code. Lovely.
jueves, 16 de octubre de 2014
Metaprogramming Zsh - Poor man's autojump (or J (or Z))
There's autojump, there's also J, there's also Z.... Each one of them with its own fans.
I've been trying some of them on and off, but mostly ditched them because I don't need the complexity and I don't get used to type 'z' when I mean 'cd'.
An easy and smart alternative is to autogenerate aliases on boot. It's easy, you can understand all the logic behind it, and your shell will provide the autocompletion. Pretty darn simple.
function aliasgen() { for i in ~/workspace/*(/) ; do DIR=$(basename $i) ; eval "alias $DIR='cd $i'"; done } aliasgen
For your usual projects, this should be more than enough. "But, but sometimes I want it more dynamic aliases, like, for random directories", I hear you say. Ok, then there's this nifty functions that also creates aliases on the fly.
function a() { alias $1=cd\ $PWD; }
When you're in a directory you wanna keep for later, type "a foo", and an alias "foo" that will go to the current directory will be generated.
Even if you wanted to persist them you could create a symbolic link from the "~/workspace" directory in the previous snippet with the choosen name.
These 2 little tricks just show how using old tools and some wit can get you going a long distance.
I hope you enjoyed this. Cya next time!
EDIT: Post deprecated in favour of CDPATH . At least I learnt a new thing . Thanks Toni!
jueves, 25 de septiembre de 2014
Back to the trenches with... speadsheets?
I'm back to reality after my craziest holidays ever. Great new people, and fun with old friends...
And I'm back with some research on spreadsheets. My new role as team leader involves some team organization and managing skills. Due to my inability to organize myself, I'm trying to solve this once for all, and it's also a good oportunity to take another look at org-mode.
I've been dabbling with org-agenda and appointments. The git repo has already some '.org' files :).
So today I was watching a few talks from the StrangeLoop 2014, and I stumbled upon this 'Spreadsheets for developers' talk. The talk has its points. I don't agree with everything that is said there but it does confirm the overally idea I already had of spreadsheets. Everyone uses them to solve their own problems. It's the emacs of non-developers.
So I remembered org-spreadsheet, and hacked a bit with it. It's really impressive, and, although a bit cumbersome in the beginning, I think it has lots of potential. And if spreadsheets are code, org-spreadsheet is more code than excel
There are many many different shortcuts but you only need a few to get started.
I really encourage you to read the manual and also the tutorial, where you'll find out how to write formulas with Calc or elisp.
Also a nice trick is the org-table-to-lisp function, that will parse the table the cursor is on and give you a list of lists with the data.
And I'm back with some research on spreadsheets. My new role as team leader involves some team organization and managing skills. Due to my inability to organize myself, I'm trying to solve this once for all, and it's also a good oportunity to take another look at org-mode.
I've been dabbling with org-agenda and appointments. The git repo has already some '.org' files :).
So today I was watching a few talks from the StrangeLoop 2014, and I stumbled upon this 'Spreadsheets for developers' talk. The talk has its points. I don't agree with everything that is said there but it does confirm the overally idea I already had of spreadsheets. Everyone uses them to solve their own problems. It's the emacs of non-developers.
So I remembered org-spreadsheet, and hacked a bit with it. It's really impressive, and, although a bit cumbersome in the beginning, I think it has lots of potential. And if spreadsheets are code, org-spreadsheet is more code than excel
There are many many different shortcuts but you only need a few to get started.
| shortcut | what it does |
|---|---|
| c-} | toggles column/row legend |
| c-' | global formula editor |
| c-` | cell editor (formulas) |
| c-c c-c (on #tblfm) | updates table recalculating |
| s-RET | inserts previous number +1 |
I really encourage you to read the manual and also the tutorial, where you'll find out how to write formulas with Calc or elisp.
Also a nice trick is the org-table-to-lisp function, that will parse the table the cursor is on and give you a list of lists with the data.
Suscribirse a:
Entradas (Atom)