This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
""" | |
To use this script, you must be in the root directory of a Rails project that | |
is using git. You should also make sure that your directory does not contain any | |
uncommitted changes. Then run: | |
$ python rails_switch_branch.py name_of_another_branch | |
Running the above will do the following: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wake On Lan: | |
Mi router es un Comtrend y este router en particular la tabla ARP no hay manera de crear entradas permanentes desde la UI web, pero se puede via telnet. No recuerdo ahora exactamente bajo cuales circunstancias se olvidaba de las entradas ARP que se creaban automáticamente, creo que si reiniciabas el router las perdía o algo. Entonces busqué la manera de recrear estas entradas de forma automática periódicamente mediante un script para que estuviesen al día y poder enviar el magic packet y que el router supiese a cual ordenador pasarlo. | |
La solución con la que he dado es esta: | |
1. | |
Instalar SleepWatcher http://www.bernhard-baehr.de es un programa que lo instalas con launchd y te permite ejecutar scripts cuando el ordenador se duerme o despierta. | |
2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are 2 code snippets: | |
(1) Compute one-hot encoded data for Spark, using the data generated by https://github.com/szilard/benchm-ml/blob/master/0-init/2-gendata.txt | |
(2) Run MLlib, computing soft predictions by hand. | |
I ran these with Spark 1.4, and they should work for 1.5 as well. | |
Note: There's no real need to switch to DataFrames yet for benchmarking. Both the RDD and DataFrame APIs use the same underlying implementation. (I hope to improve on that in Spark 1.6 if there is time.) | |
Ran on EC2 cluster with 4 workers with 9.6GB memory each, and 8 partitions for training RDD. | |
For the 1M dataset, training the forest took 2080.814977193 sec and achieved AUC 0.7129779357732448 on the test set. |