Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, June 22, 2017

Download a part of YouTube video as mp3

I will be using ffmpeg and youtube-dl installed linux distro (Ubuntu 16.04 LTS)
ffmpeg -ss 00:00:00.0000 -i $(youtube-dl -f 22 --get-url <YOUTUBE_LINK>) -t 00:00:00.0000 -acodec libmp3lame -qscale:a 0 sample.mp3
Fill <YOUTUBE_LINK> with the link to YouTube video.

Find further explanation of above command here,
  • -ss : start of the stream 00:00:00.0000 stands for hour:minute:second.millisecond
  • -i   : provide the input, here we will be using an output from youtube-dl.
  • -t   : length of the stream

Further information about bitrate selection (-qscale:a 0) can be found here.
  • libmp3lame is the audio encoding used for this purpose.
  • sample.mp3 is the output file of above command.

Thursday, December 11, 2014

banish404 | Easy way to remove stale PPAs and Software-Sources

Are you having trouble manually updating PPAs and Software-Sources from your Ubuntu box to solve 404 not founds while updating the system. (I tried banish404 on 13.10).

Issues I'm having while running apt update,
 
Err http://ppa.launchpad.net saucy/main amd64 Packages
  404  Not Found
Err http://ppa.launchpad.net saucy/main i386 Packages
  404  Not Found

Ign http://ppa.launchpad.net saucy/main Translation-en_US
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en_US
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en_US
Ign http://ppa.launchpad.net saucy/main Translation-en
Ign http://ppa.launchpad.net saucy/main Translation-en_US
Ign http://ppa.launchpad.net saucy/main Translation-en
Fetched 13.0 kB in 16s (772 B/s)
W: Failed to fetch http://ppa.launchpad.net/psyke83/ppa/ubuntu/dists/saucy/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/psyke83/ppa/ubuntu/dists/saucy/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.


banish404 is a simple tool to automate this hassle.

sudo add-apt-repository ppa:fossfreedom/packagefixes
sudo apt-get update
sudo apt-get install banish404

How to use,
sudo banish404
This will ask for your permission one-by-one to remove stale PPAs and  Software-Sources.More importantly it will back-up your existing sources in to the /etc/apt/ directory.

udara@udara-home:~$ sudo banish404
sources backup folder: /etc/apt/sources_20141210-12:18:33
: 3 3    
checking PPAs...
Disabling /etc/apt/sources.list.d/psyke83-ppa-saucy.list...
Done!
Disabling /etc/apt/sources.list.d/psyke83-ppa-saucy.list...
Done!
checking software sources...


Now if I run apt update, I don't see any 404 not founds.

Saturday, November 1, 2014

Optimizing eclipse IDE on a Ubuntu box

I'm currently using eclipse Luna on my Ubuntu 13.10, IDE crashes after few seconds.
While searching google for a fix I found number of SO replies with following update to eclipse.ini ,
-Dorg.eclipse.swt.browser.DefaultType=mozilla
But it does not seem to fix my issue, then I tweaked existing eclipse.ini as follows,

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=512m
#-Xms40m
#-Xmx512m
-Dorg.eclipse.swt.browser.DefaultType=mozilla
I have commented out ms & mx parameters to pick my system parameters, then increased MaxPermSize to 512 MB.

Eclipse issue seems to be fixed now !!

Friday, January 17, 2014

Install PostgreSQL 8.X on Ubuntu 12.10

If you try to install PostgreSQL on ubuntu using apt-get install postgresql command it will automatically fetch and setup PostgreSQL 9.X.

If following methods are not any option to install PostgreSQL you may continue this blog post.

1. Build using the source code.
2. Downloading deb package and install.

Lets configure our system by updating source list so we can simply install  PostgreSQL using apt-get install postgresql-8.X :)

First create pgdg.list file inside /etc/apt/sources.list.d/ directory with the following content.
deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main
Next import sigining key for this repository by executing following command in terminal.
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
You are done, simply run "sudo apt-get update" before installing
PostgreSQL 8.X.

Wednesday, November 13, 2013

User groups in Linux

While performing particular task in Linux based distro one might need to verify if that user belongs to a group with right permissions.

You can verify this using two simple commands.Open your terminal and run groups,
udara@thinkPad:~$ groups
udara adm cdrom sudo dip plugdev lpadmin sambashare
This will show the groups which logged-in user belong to.

If you wish to find the groups of any other user just run, groups {user_name},
udara@thinkPad:~$ groups udara
udara : udara adm cdrom sudo dip plugdev lpadmin sambashare
udara@thinkPad:~$ groups root
root : root