Remember my previous two blog posts about publishing 30 and 20 of my projects to github? Here are another 10 projects in no particular order that I've written since then.

I really love writing open source projects. Everyone should publish all their projects to github. Good or bad. Like my friend just said: "Publish more open source, not less. "Too much noise" is a terrible excuse. Publish wisdom so we may use. Publish mistakes so we may learn."

If you find my projects interesting, consider following me on github! Thank you!

Shorten urls with bitly without api

This is a Perl module that shortens urls via bitly without using their API. I once had to shorten more than a few hundred urls quickly so I wrote this.

Here's an example of how to use it:

use bitly;

my $bitly = bitly->new('username', 'password');
my $url = bitly->shorten('http://www.url.com');

unless ($url) {
    say $bitly->{error};
}
else {
    say $url;
}

Speak text files to wav via Microsoft Speech API

I once had this idea of converting my blog posts to mp3. So I wrote a C++ program that uses the Microsoft's speech api. It takes a txt file as input and produces a wav file output.

Usage:

speak.exe <voice name> <text file> <wav file>
-or-
speak.exe --list-voices

Compile this project with Microsoft Visual Studio 2008 or later.

Bonus: At first I tried using Loquendo SDK and created a TextToWav project but their speech engine wasn't too great so I created speak-text-files-to-wav.

Load status server for Windows

This simple C++ program creates a single threaded TCP server that replies with information in JSON format about Window's CPU, Disk, and Memory usage. I created this because I had to monitor Windows servers at Browserling.

Here's an example:

C:\bin\> load-status-server.exe
Started server on port 7000

Now if you connect to server.com:7000, it will send you JSON with the current server load info:

$ nc server.com 7000
{
    "memory": {
        "usage": 71,
        "total_physical": 1068388352,
        "free_physical": 302112768,
        "total_paging_file": 3096842240,
        "free_paging_file": 2155446272,
        "total_virtual": 2147352576,
        "free_virtual": 2130919424,
        "free_extended_virtual": 0
    },
    "cpu": {
        "load": 5
    },
    "disk": {
        "free_user": 22858027008,
        "free_total": 22858027008,
        "total": 42947571712
    }
}

Compile this project with Visual Studio or mingw. It uses just Win32 calls.

HWND finder

We started working on a new product at Browserling that takes screenshots so I wrote a bunch of code that finds browser window HWNDs. Then I decided to open source some parts of it and created HWND finder. The idea is to have something like jQuery's syntax for finding HWNDs. We delayed launching this screenshot product so I haven't made any updates.

Here's an example:

#include "hwnd-finder.h"

HwndFinder hf;
HWND rendererHwnd = hf.find("Chrome_WidgetWin_1 > Chrome_WidgetWin_0 > Chrome_RenderWidgetHostHWND");

This finds Chrome renderer's window handle. Here Chrome_RenderWidgetHostHWND is a child of Chrome_WidgetWin_0 is a child of Chrome_WidgetWin_1 which is the top window.

node-number-range

This is a node.js module that streams number ranges. Here are all the ranges it supports:

var range = require('number-range');

* range(10) - range from 0 to 9
* range(-10, 10) - range from -10 to 9 (-10, -9, ... 0, 1, ... 9)
* range(-10, 10, 2) - range from -10 to 8, skipping every 2nd element (-10, -8, ... 0, 2, 4, 6, 8)
* range(10, 0, 2) - reverse range from 10 to 1, skipping every 2nd element (10, 8, 6, 4, 2)
* range(10, 0) - reverse range from 10 to 1
* range('5..50') - range from 5 to 49
* range('50..44') - range from 50 to 45
* range('1,1.1..4') - range from 1 to 4 with increment of 0.1 (1, 1.1, 1.2, ... 3.9)
* range('4,3.9..1') - reverse range from 4 to 1 with decerement of 0.1
* range('[1..10]') - range from 1 to 10 (all inclusive)
* range('[10..1]') - range from 10 to 1 (all inclusive)
* range('[1..10)') - range grom 1 to 9
* range('[10..1)') - range from 10 to 2
* range('(1..10]') - range from 2 to 10
* range('(10..1]') - range from 9 to 1
* range('(1..10)') - range from 2 to 9
* range('[5,10..50]') - range from 5 to 50 with a step of 5 (all inclusive)
* range('10..') - infinite range starting from 10
* range('(10..') - infinite range starting from 11

Very cool stuff. Especially the infinite ranges, which use the process.nextTick trick.

HTTP::Async::Retry

It's almost HTTP::Async::Retry. It's actually just a async_retry.pm file that you can drop into your project to do a quick hack. With a bit of effort it could be HTTP::Async::Retry.

I once had to scrape a lot of information so I used my favorite language Perl and used the HTTP::Async module. A lot of URLs would time out as I was creating thousands of connections per second. At first I simply copied the retry code from hack to hack but then at one moment I had enough so I simply wrote async_retry.pm that abstracts away the retries.

Here's an example:

use warnings;
use strict;

use HTTP::Request;
use async_retry qw/async_retry/;

my @urls = (
    'http://www.google.com/1';,
    'http://www.google.com/2';,
    'http://www.google.com/3';,
    'http://www.google.com/';,
    'http://www.google.com/5';,
);

async_retry(
    {
        retries => 5
    },
    [
        map { HTTP::Request->new(GET => $_) } @urls
    ],
    sub {
        my ($req, $res) = @_;
        print $res->base, "\n";
    }
);

This code tries to get all those Google urls and retries to get them 5 times. If a url succeeds or fails after retries, it calls the callback with HTTP::Request and HTTP::Response objects.

HTML Keyboard Widget

This is just an on-screen keyboard widget for Browserling. I wrote it because people with weird keyboard layouts couldn't input various English characters in Browserling. We'll add it to Browserling soon (it's a planned feature.)

Here's how it looks like:

You can try a live demo here.

Cached browser badges

This project just creates cached browser badges for Testling, so that we don't have to generate them again as it's costly.

~/.ssh/authorized_keys ssh key manager

This project manages public ssh keys in ~/.ssh/authorized_keys file. We'll use this at Browserling to manage the ssh keys for tunnels so that you can add, remove and list the keys. (It's a planned feature.)

Here's an example:

var sshManager = require('ssh-key-manager');
sshManager.addKey('pkrumins', 'ssh-rsa AAAAB3NzaC1y...', function (err) {
    if (err) {
        console.log(err);
        return;
    }
});

node-tree-kill

This is a node.js module that kills all processes in the process tree, including the given root process.

Here's an example:

var kill = require('tree-kill');
kill(301, 'SIGKILL');

In this example we kill all the children processes of the process with pid 301, including the process with pid 301 itself.

This module currently works on Linux only as it uses ps -o pid --no-headers --ppid PID to find the parent pids of PID.

GitHub is awesome!

Push all your projects to github all the time! Don't let your project rot on your hard drive! Publish it to github! Publish wisdom so we may use. Publish mistakes so we may learn.

And just another reminder, I'd love if you followed me on github and twitter! :)

Comments

August 05, 2013, 22:51

Wow, it's amazing, that script is very difficult for me.

August 11, 2013, 14:06

You have done a great job by writting this article, I can see that you have good programming skils. I hope to see some more work from you.

August 20, 2013, 21:30

Thank you for you information. It's help me more

September 03, 2013, 06:45

Interesting blog. A lot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definitely interested in this one. Just thought that I would post and let u know.

September 03, 2013, 10:09

Nice collection and nice Post

October 28, 2013, 19:40

Wonderful article. Thanks for taking the time to discuss this. Your blog provided us valuable information to work on. I like the valuable information you provide in your articles.

February 01, 2014, 14:43

Der Bye Bra Klebe-BH (was soviel heisst wie „tschüss BH“) ist eine einfache Lösung, um die weibliche Brust optimal zu präsentieren – schnell, effektiv und dies ganz ohne BH oder gar Operation! Der Bye Bra hebt die Brüste einfach und effektiv an. Und nicht nur das – auch die Stimmung, das Wohlbefinden und das Selbstwertgefühl der Trägerin wird angehoben.
http://byebra.at

February 01, 2014, 14:45

Le Bye Bra (Soutien-Gorge Adhésif) est une solution simple pour améliorer rapidement et efficacement la poitrine de la femme sans avoir besoin d’une intervention chirurgicale ou même d’un soutien-gorge! Le Bye Bra peut rehausser les seins, simplement et efficacement. Mieux encore, non seulement il permet de rehausser – mais il suscite également une meilleure humeur et estime de soi chez la femme de manière significative. Non seulement, il vous donne le sentiment de confiance d’une apparence plus attrayante,

http://byebra.be

March 07, 2014, 20:09

Heatmap theme are nice try it out

June 26, 2014, 09:22

Ok is so nice to read

October 14, 2014, 09:37

Great post.
showsjunction.

Kaur deep Permalink
December 04, 2014, 03:31

Excellent and knowledgeable links and post.thanks for sharing.
Now, The Time has come for the Happy New Year 2015. It wil bring a lot fo happinesin our life.
Happy New Year 2015
And I am sure, You wil anjoy this new year day with yoru fiends and wil send some images wishes,
New Year 2015

Happy New Year 2015 Wishes
Greetings to yoru close ones, Your friends, You lover, etc..
Happy New Year 2015 Images
Even I am waititng for that day, because it just changes our life.
Happy New Year 2015 Greetings

Happy New Year 2015 SMS
So, That's why I am commenting here to wish you a very happy new year.
Happy New Year 2015 Messages
I hope this New year 2015 wil bring success to your website. But before that Merry Christmas is coming.
Merry Christmas Quotes
It is also a big event for everyone.
Merry Christmas Pictures
Everyone knows that Christmas is a day when People seems to be very happy, they just leave all sadness behind.
Merry Christmas Wallpapers
And I am sure, you also enjoy this Merry Christmas day of 2014.
Christmas day Images

Christmas stocking
But if you are not looking out to enjoy this christmas, then you are missing out on a big thing, because it really brings happiness.
Merry Christmas Images

Merry Christmas 2014
So, what you are waiting for?
Merry Christmas 2015
Enjoy This Merry Christmas day. Cheers :).

December 09, 2014, 09:36

nice
lingaa movie download torrent
a href=" http://mynycstreets.com/2014/12/download-lingaa-movie-torrentlingaa-movie-free-download/">Lingaa Movie Torrent Downl

<oad>

lingaa movie in mp4lingaa movie in hdlingaa movie in free downloadLingaa Movie download in torrentfree download lingaa movie
diggnice article

Diana Permalink
December 17, 2014, 15:19

This article is quite helpful and informative too. I enjoyed a lot. Thanks for sharing such a great article.

christmas quotes
christmas wishes quotes
merry christmas quotes
funny christmas quotes
inspirational christmas quotes
christmas eve quotes
best christmas quotes
famous christmas quotes
happy christmas quotes
christmas blessing quotes
christmas greeting quotes
quotes about christmas
christmas inspirational quotes

merry christmas message for Whatsapp
christmas message for Whatsapp
Christmas Messages for Whatsapp
christmas message
christmas greetings message
christmas greeting messages
christmas greetings message
christmas greeting message
christmas messages
christmas card messages
christmas greeting card messages
christmas messages for cards
christmas sms messages
christmas message for friends
merry christmas message
christmas message for family
christmas wishes messages
christmas cards messages
funny christmas messages
top christmas messages
best christmas messages
besutiful christmas messages

christmas greeting
christmas greeting cards
christmas greetings for cards
christmas greeting words
christmas wishes greetings
christmas greetings wishes
free christmas greetings
merry christmas greeting
christmas cards greetings
christmas card greetings
christmas greetings
christmas greeting card sayings
christmas greetings sayings

christmas wishes
christmas wishes text
merry christmas wishes
christmas wishes messages
christmas wishes for cards
best christmas wishes
funny christmas wishes
christmas wishes for friends
christmas wishes words
christmas wishes sms
christmas wish
merry christmas wishes messages

christmas wishes sayings
christmas greeting card sayings
christmas greetings sayings
What to Write in Christmas Card

christmas wallpaper
free christmas wallpaper
christmas wallpapers
merry christmas wallpaper
christmas wallpaper hd
christmas desktop wallpaper
free christmas wallpapers
merry christmas wallpapers
christmas tree wallpaper
animated christmas wallpapers
hd christmas wallpapers
wallpaper christmas

christmas tree decoration
christmas tree decorating ideas
christmas tree decorations
christmas tree decoration ideas
christmas tree decorating
christmas tree decorations ideas

Thanks for sharing such a great article.

Diana Permalink
December 17, 2014, 15:19

This article is quite helpful and informative too. I enjoyed a lot. Thanks for sharing such a great article.

christmas quotes
christmas wishes quotes
merry christmas quotes
funny christmas quotes
inspirational christmas quotes
christmas eve quotes
best christmas quotes
famous christmas quotes
happy christmas quotes
christmas blessing quotes
christmas greeting quotes
quotes about christmas
christmas inspirational quotes

merry christmas message for Whatsapp
christmas message for Whatsapp
Christmas Messages for Whatsapp
christmas message
christmas greetings message
christmas greeting messages
christmas greetings message
christmas greeting message
christmas messages
christmas card messages
christmas greeting card messages
christmas messages for cards
christmas sms messages
christmas message for friends
merry christmas message
christmas message for family
christmas wishes messages
christmas cards messages
funny christmas messages
top christmas messages
best christmas messages
besutiful christmas messages

christmas greeting
christmas greeting cards
christmas greetings for cards
christmas greeting words
christmas wishes greetings
christmas greetings wishes
free christmas greetings
merry christmas greeting
christmas cards greetings
christmas card greetings
christmas greetings
christmas greeting card sayings
christmas greetings sayings

christmas wishes
christmas wishes text
merry christmas wishes
christmas wishes messages
christmas wishes for cards
best christmas wishes
funny christmas wishes
christmas wishes for friends
christmas wishes words
christmas wishes sms
christmas wish
merry christmas wishes messages

christmas wishes sayings
christmas greeting card sayings
christmas greetings sayings
What to Write in Christmas Card

christmas wallpaper
free christmas wallpaper
christmas wallpapers
merry christmas wallpaper
christmas wallpaper hd
christmas desktop wallpaper
free christmas wallpapers
merry christmas wallpapers
christmas tree wallpaper
animated christmas wallpapers
hd christmas wallpapers
wallpaper christmas

christmas tree decoration
christmas tree decorating ideas
christmas tree decorations
christmas tree decoration ideas
christmas tree decorating
christmas tree decorations ideas

Thanks for sharing such a great article.

Leave a new comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "floppy_383": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.

Advertisements