Wednesday, December 21, 2016

Bash Script Check

You like to Bash Script, and would like someone to review your code?

KoalaMan is constantly working on such a project, and it looks to be very good! You just have to paste your Bash Script at the left box and it will be evaluated. Easy like that!

That's my example, a simple BashScript that does nothing. But KoalaMan implemented classic Bash scripting rules to it. Awesome!

This is a "MustHaveInMyList" link: http://www.shellcheck.net/


No automatic alt text available.

Sunday, October 16, 2016

SD Card on Ubuntu 16.04

I have tried to access my pictures on my Ubuntu desktop 16.04, the Xenial Xerus. Did not work! The solution was install some packages that were lacking:

sudo apt-get install exfat-fuse exfat-utils

After that, it still did not work! I should have to do something else manually. Simply restarted and it worked!

Thanks to Ubuntu Geek for this tip!

If this post may be useful to you, please let me know: "Like" it and share it.

Thursday, January 21, 2016

Resizing a bunch of pictures

I want to upload some of my pictures to some social network. But all of them have big resolution, and so will take a long time to upload. Besides, some time I need to save storage space.

Again, I can use Gimp for that. But when you have 200 pics, or even much more Gimp is not a good option. Let's see how we can get this done easily in command line.

You need:
  • The software graphicsmagick installed (sudo aptitude install graphicsmagick)
  • A directory with your original pictures
  • A directory for your signed pictures
For this example, consider that:

  • My pictures are in ~/Pictures/Lake
  • My resized pictures will be at ~/Pictures/Lake/Small 
  • All my original pictures have an extension .jpg.
This task is resolved with this simple CLI instruction:

for i in $(ls ~/Pictures/Lake/*.jpg) ; do echo $i; gm convert -resize 30% "${i}" "$(dirname ${i})/Small/$(basename ${i})" ; done

Note that my result will be pictures 30% of the original, and with the same name. After this, view the results and make the pictures bigger or smaller.

See the results of my example:
Compare the size of both files


If this post may be useful to you, please "Like" it and share it.

Wednesday, January 20, 2016

How to add watermark to a bunch of pictures

Adding a watermark to many pictures using a powerful tool as GIMP may take a long time. Let's see how we can get this done easily in command line.

You need:
  • The software graphicsmagick installed (sudo aptitude install graphicsmagick)
  • Your watermark with transparent background (mine is a PNG image)
  • A directory with your original pictures
  • A directory for your signed pictures
For this example, consider that:

  • My pictures are in ~/Pictures/Lake, my signed pictures will be at ~/Pictures/Lake/Signed and my watermark is ~/Pictures/sign.png.
  • All my original pictures have an extension .jpg.
  • Also, my watermark will be written in lower right corner (SouthEast), but there are more options (NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast).
This task is resolved with this simple CLI instruction:

for i in $(ls ~/Pictures/Lake/*.jpg); do echo ${i}; gm composite -gravity SouthEast ~/Pictures/sign.png ${i} "$(dirname ${i})/Signed/$(basename ${i})"; done

Of course, if your directory is different, you will have to modify the CLI instruction above.

Here is the result:
Without my watermark
With my watermark


If this post may be useful to you, please "Like" it and share it. If people "Like" it, I may show how I did my watermark using Gimp.

Monday, September 21, 2015

Apple devices massive attack

Recently I wrote here about security for end users, comparing Apple and Linux softwares with Microsoft Windo

Unfortunately, I have just learned that a massive attack is ongoing on several Apps for Apple's mobile devices (iPhone, iPad, etc).

I have read many technical news with their "weird" jargon. And here is, in simple words, what happened:

Software developers need XCode, a software tool provided by Apple itself. Many of them downloaded a Chinese version of the tool, instead of Apple's original version. So, the softwares built with these forfeit version of XCode are all compromised. Roughly, there may be something around 400-500 softwares compromised.

What damage can they cause?
According to BBC, "[...]the perpetrators would also be able to send fake alerts to infected devices to trick their owners into revealing information. It added they could also read and alter information in compromised devices' clipboards, which would potentially allow them to see logins copied to and from password management tools"

What can be done?
You should remove the App if it is one of the compromised. You can read here is a list of some of them, but this list is not complete. Good news: Apple is taking car of it for you! According to CNBC, "Apple said it was cleaning up its iOS App Store to remove malicious iPhone and iPad programs identified in the first large-scale attack on the popular mobile software outlet". Bad news: Apple has not finished it's cleaning job.

Conclusion:
Please, just do not go on installing any Apps just because the daughter of the distant cousin of the neighbor of your friend's dentist told you "it rocks"!!! It does not matter which device you have, you might be in for it.