Send all new files saved in a directory as email attachments

I wanted to send by email scans made with the printer I have at work. Once I have them in my email, it’s easier to archive/send them more easily.

Problem: the printer software is bugged and doesn’t allow to use my long, complex password, so I had two options:

  • Change the email password to be shorter
  • Think a workaround via a linux server

Obviously I opted for the second option!

It works like this: we tell the printer to save the PDFs on a network share, inotifywait waits that a new file is created, and then sendEmail sends it as an email attachment

The script has to be ran in a screen, and it runs in an infinite loop

Your website could be used for a mail bombing

Today, by pure luck, I looked quickly to the mail server logs. Since the beginning of the year it has sent about 1500 emails.

“Ah, ok”, I think, and I move on.

Then I think about it. Hey, 1500 emails sent in a couple of days???

Looking the logs I immediately found the culprit:

After every post of a WordPress website it was enabled “share by email”!

A chinese bot, every minute, was going to the page and was sending the content to the same email address!

Result: a mail bombing!

I hope that my IP address reputation is not tarnished and doesn’t affect my deliverability…. 😡

Codeanywhere – the review

I clicked on “free account”, I wrote an email and password and boom, already registred!

Once logged in it asked me which preinstalled “stack” I want to use, from:

  • PHP
  • Node.js
  • Ruby
  • Python
  • C++
  • HTML5

Or, I can just connect to my own VM via SSH.

For example, PHP says:

PHP Development Box on Ubuntu 14.04 with Apache, PHP, MySQL, phpMyAdmin and Composer preinstalled. 

Starting up is very quick, the virtual machine is created in a few seconds, and Apache is already listening on port 80.

In less than a minute I can publish online a php file.

It’s well integrated with GIT.

The only drawback is that everything is organized like “every project gets its own virtual machine”, with GIT and Apache set to work in the main directory.

Of course, since it’s a virtual machine, I can live without native integration, I configure Apache and git in my way via command line, but that’s not as comfortable as doing with a few clicks.

It can automatically save files, but it’s disabled by default, because the free version doesn’t keep the edit history: if you pay you can get the history, and that’s a nice feature for who doesn’t want to use GIT and prefers to save on Dropbox.

Another great thing is that the SSH public key of the virtual machine can be generated and copied with just one click on the username, so it’s very fit for git. About git, when I have a commit, I can’t select a single file, but it’s “all or nothing”. I think this is still because of the logic “every project gets its own virtual machine”, and this makes sense: why should I sign up to the Freelance edition and pay $7 monthly if the free version can easily allow me to manage an unlimited amount of projects? If I don’t pay I have to set and use apache/git/other tool from the command line. If I was to use this webapp everyday for work, the Freelance subscription would be a no-brainer. It’s so handy to have a perfectly “clean” virtual machine with the right tools and always available for every project?

If you register to Codeanywhere using my link:
http://codeanywhere.com/referralsignup/?r=44733c37687e396531
you will receive $15 in free credit if you sign up for a paid subscription.

List of online developing environments

Now that there’s the “cloud mania”, there are dozens of websites that allow to code online without install any program on the local computer. That’s perfect for who, like me, uses 2 computers at work, 2 computers at home, and often uses someone else’s computer: the problem is that my free time is limited, but if I don’t have all the tools set up as I need, I can’t develop or continue a project.

In this way I could write something during lunch time break at work, continue it in my train commute, finishing at home.

The most promising online developing environments (cloud IDE) that I found are:

For me, the most important feature is native GIT support. It looks like that all those seven webapps have this feature.

First of all, I will try codeanywhere, because it looks like it’s the only one with an Android app, so, maybe, I can use it from my BlackBerry Z10.

Another “feature” is the price, because almost all my project aren’t generating profits, so I can’t pay big subscription fees. This is the reason I won’t even try Codio, because, if you don’t pay, after 30 days the workspaces become public.

Soon I will publish a review for Codeanywhere 😀

A Javascript code that looks like Japanese smileys

What do you see here?

゚ω゚ノ= /`m´)ノ ~┻━┻   //*´∇`*/ [‘_’]; o=(゚ー゚)  =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); (゚Д゚) =(゚Θ゚)= (o^_^o)/ (o^_^o);(゚Д゚)={゚Θ゚: ‘_’ ,゚ω゚ノ : ((゚ω゚ノ==3) +’_’) [゚Θ゚] ,゚ー゚ノ :(゚ω゚ノ+ ‘_’)[o^_^o -(゚Θ゚)] ,゚Д゚ノ:((゚ー゚==3) +’_’)[゚ー゚] }; (゚Д゚) [゚Θ゚] =((゚ω゚ノ==3) +’_’) [c^_^o];(゚Д゚) [‘c’] = ((゚Д゚)+’_’) [ (゚ー゚)+(゚ー゚)-(゚Θ゚) ];(゚Д゚) [‘o’] = ((゚Д゚)+’_’) [゚Θ゚];(゚o゚)=(゚Д゚) [‘c’]+(゚Д゚) [‘o’]+(゚ω゚ノ +’_’)[゚Θ゚]+ ((゚ω゚ノ==3) +’_’) [゚ー゚] + ((゚Д゚) +’_’) [(゚ー゚)+(゚ー゚)]+ ((゚ー゚==3) +’_’) [゚Θ゚]+((゚ー゚==3) +’_’) [(゚ー゚) – (゚Θ゚)]+(゚Д゚) [‘c’]+((゚Д゚)+’_’) [(゚ー゚)+(゚ー゚)]+ (゚Д゚) [‘o’]+((゚ー゚==3) +’_’) [゚Θ゚];(゚Д゚) [‘_’] =(o^_^o) [゚o゚] [゚o゚];(゚ε゚)=((゚ー゚==3) +’_’) [゚Θ゚]+ (゚Д゚) .゚Д゚ノ+((゚Д゚)+’_’) [(゚ー゚) + (゚ー゚)]+((゚ー゚==3) +’_’) [o^_^o -゚Θ゚]+((゚ー゚==3) +’_’) [゚Θ゚]+ (゚ω゚ノ +’_’) [゚Θ゚]; (゚ー゚)+=(゚Θ゚); (゚Д゚)[゚ε゚]=’\\’; (゚Д゚).゚Θ゚ノ=(゚Д゚+ ゚ー゚)[o^_^o -(゚Θ゚)];(o゚ー゚o)=(゚ω゚ノ +’_’)[c^_^o];(゚Д゚) [゚o゚]=’\”‘;(゚Д゚) [‘_’] ( (゚Д゚) [‘_’] (゚ε゚+(゚Д゚)[゚o゚]+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((゚ー゚) + (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ ((o^_^o) – (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+((゚ー゚) + (゚Θ゚))+ (c^_^o)+ (゚Д゚)[゚ε゚]+(゚ー゚)+ ((o^_^o) – (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (c^_^o)+ (o^_^o)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ ((゚ー゚) + (o^_^o))+ (゚Д゚)[゚ε゚]+(゚ー゚)+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚ー゚)+ ((o^_^o) – (゚Θ゚))+ (゚Д゚)[゚ε゚]+((゚ー゚) + (゚Θ゚))+ (゚Θ゚)+ (゚Д゚)[゚o゚]) (゚Θ゚)) (‘_’);

It may look like a random array of kaomoji, the japanese smileys like (o^_^o) , (゚ー゚) , ゚ω゚ノ , *´∇`* or this monkey head (゚Θ゚); instead it’s real Javascript code, and you can run it by, clicking here.

Awesome, right?

You can find the obfuscator here: http://utf-8.jp/public/aaencode.html

Also, from the same website there is also one that only uses []()!+ and another one that makes stuff like this:

dandandin=~[];dandandin={___:++dandandin,$$$$:(![]+””)[dandandin],__$:++dandandin,$_$_:(![]+””)[dandandin],_$_:++dandandin,$_$$:({}+””)[dandandin],$$_$:(dandandin[dandandin]+””)[dandandin],_$$:++dandandin,$$$_:(!””+””)[dandandin],$__:++dandandin,$_$:++dandandin,$$__:({}+””)[dandandin],$$_:++dandandin,$$$:++dandandin,$___:++dandandin,$__$:++dandandin};dandandin.$_=(dandandin.$_=dandandin+””)[dandandin.$_$]+(dandandin._$=dandandin.$_[dandandin.__$])+(dandandin.$$=(dandandin.$+””)[dandandin.__$])+((!dandandin)+””)[dandandin._$$]+(dandandin.__=dandandin.$_[dandandin.$$_])+(dandandin.$=(!””+””)[dandandin.__$])+(dandandin._=(!””+””)[dandandin._$_])+dandandin.$_[dandandin.$_$]+dandandin.__+dandandin._$+dandandin.$;dandandin.$$=dandandin.$+(!””+””)[dandandin._$$]+dandandin.__+dandandin._+dandandin.$+dandandin.$$;dandandin.$=(dandandin.___)[dandandin.$_][dandandin.$_];dandandin.$(dandandin.$(dandandin.$$+”\””+dandandin.$_$_+(![]+””)[dandandin._$_]+dandandin.$$$_+”\\”+dandandin.__$+dandandin.$$_+dandandin._$_+dandandin.__+”(\\\”\\”+dandandin.__$+dandandin.___+dandandin._$$+”\\”+dandandin.__$+dandandin.$_$+dandandin.__$+dandandin.$_$_+dandandin._$+”\\\”)”+”\””)())();

Learn Javascript with Codecademy

If you love to learn how to program in Javascript, you would be happy to know about Codecademy.

Maybe it’s too easy for who has some experience, but in the end it’s useful, and with the gamification of the lessons, it’s funny to collect all the badges, here is my profile, with all badges collected, hahaha).

If you don’t have any programming experience, it’s useful because it explains very well.

If you, like me, learned Javascript by yourself, it’s still useful; maybe sometimes it’s a little bit boring, but there is still something that you didn’t know about, for example I had no idea what a ternary operator was (Even if, during the rest of the course, you are asked to use the classic if-else in situations where the ternary operator will be perfect).

If you are a professional, this course it’s totally useless – maybe you can think about it as a typing lesson 😝

Right now there are only Javascript lessons, in future Python and Ruby courses will be added.