Wednesday, February 8, 2017

Disabling/Changing Drum Beat Sound On Ubuntu Startup

Disabling/Changing Drum Beat Sound On Ubuntu Startup

Ubuntu would always play, Drum Beat sound on Ubuntu system startup, But some people may find this is annoying and want to disable or want to change it with their own custom alert sound... Unfortunately, Ubuntu haven't provided a simpler GUI way to disable/customize the startup sound (so far I know..).

However, it's not that much hard to disable/change the startup sound. In this post I will show you how to change/disable startup sound in Ubuntu.

Mostly, All sounds which generally used by Ubuntu are .ogg format sound files and they are located in /usr/share/sounds/ubuntu/. We can disable or change the startup sounds just by renaming/replacing the corresponding sound file...

Disable Startup Sound :

To disable startup sound we just have to rename the file named system-ready.ogg which is located in /usr/share/sounds/ubuntu/stereo/. Just run the below command to disable the startup drum beat in your Ubuntu system..

sudo mv /usr/share/sounds/ubuntu/stereo/system-ready.ogg /usr/share/sounds/ubuntu/stereo/system-ready.ogg.old

Changing The Startup Sound With One You Like To Hear..

We can change/customize our startup sound just by replacing existing system-ready.ogg with our own sound file (should be in .ogg format) with existing name (system-ready.ogg)..

I have already mentioned that Ubuntu use .ogg file format for its alert sounds.. So your new sound file also should be in that format.. Don't worry, If you don't have your sound file in .ogg format.. You can just convert your sound file from current format to .ogg .. There are many tools available to do that for you.. Even you can convert it in online... media.io is one of such kind of web site where you can freely convert your sound file to .ogg format..

Now, if you have your new sound file with .ogg format in your hands.. Then... Just disable existing sound by running following commands..

sudo mv /usr/share/sounds/ubuntu/stereo/system-ready.ogg /usr/share/sounds/ubuntu/stereo/system-ready.ogg.old sudo cp /PATH_TO_YOUR_NEW_SOUND_FILE/ /usr/share/sounds/ubuntu/stereo/system-ready.ogg
Please, Don't forget to replace /PATH_TO_YOUR_NEW_SOUND_FILE/ with your files path..

For Example..

If you have your new file named beep.ogg in your Downloads directory.. Then you have to execute following command....

sudo cp ~/Downloads/beep.ogg /usr/share/sounds/ubuntu/stereo/system-ready.ogg
I have tested it in my Ubuntu Linux 16.04 LTS and Hope will work in other versions too...

That's it.. Now just restart your system and see the change... Follow us on facebook.

Tuesday, January 24, 2017

QR Code Generation Using JavaScript

QR Code Generation Using JavaScript

QR code stands for Quick Response Code. We can encode some text / string as QR Code and can retrieve it later by decoding the QR code. We can generate QR code using different programming languages in different ways but so far I know, the simplest way to generate QR code is using JavaScript.

QRCodeJs Library :

In this post, I am going to show you how to generate QR code using JavaScript. For this demo we are going to use library called QRCodeJS. In short QRCodeJS is a JavaScript library that makes generation of QRCode for given string easy using JavaScript.

Basic Usage:

Just create a new html file, include qrcode.js file and copy paste the below code into your html file..

<div id="qrcode"></div> <script> new QRCode(document.getElementById('qrcode'), 'Hello, World'); </script>

It just needs user to write two lines of code.. The first line is DIV element in which we want to display our generated QR Code. The next thing we have to do is, creating the instance of QRCode object with our custom values. It takes two parameters, first one is HTML Element | Object in which we want to display QR Code and the second parameter is text | String which we want to encode as QR Code.

Live Demo

Type something in below input field...

Here, you can see/get the full code for above demo..

QR Code Generation With Custom Options :

You can customize QR Code generation by configuring QRCode object.

<div id="qrcode"></div> <script> var qrcode = new QRCode(document.getElementById('qrcode'), { text: 'Hello, World', width: 500, height: 500, colorDark : 'brown', colorLight : 'lime', correctLevel : QRCode.CorrectLevel.H }); </script>

Some other methods available in QRCode generator..

qrcode.clear(); // This method will clear the current code. qrcode.makeCode('Hello, User'); // This will generate new code.

That's it for now.. Follow us on Facebook
Don't forget to share it with your friends...