Click Technology

Linux, Windows, Mac it's all good

iptables and Deluge..

September5

Deluge is a torrent client for Linux. It’s cool because, as well as being well laid out, it also does magnet links for downloads. From a command window, install it with this command..

sudo apt-get install deluge

Next, we need to adjust the ports used by Deluge. Go CTRL + p to open the ‘P’roperties page. Click Network.

Uncheck the “Use random ports” boxes in bot Incoming and Outgoing channels sections.

Enter a value range in the ports boxes. The port values here can be anything you like in the 50,000 to 64,000 value range. Let’s say we chose 55055 to 55065. Enter these two values in the From and To boxes for both incoming and outgoing port numbers.

Once that’s done, you need to configure your firewall. If you’re using iptables, you’ll need to open some ports to get it working. Here’s the comand list to get you working…

sudo iptables -A INPUT -p tcp -m tcp --dport 55055:55065 -m state --state NEW -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --dport 55055:55065 -m state --state NEW -j ACCEPT
sudo iptables -A OUTPUT -p tcp -m tcp --sport 55055:55065 -m state --state NEW -j ACCEPT
sudo iptables -A OUTPUT -p udp -m udp --sport 55055:55065 -m state --state NEW -j ACCEPT

The commands above allow tcp and udp in and out to the port range chosen, as required. Once that’s done, Deluge should work perfectly.

Nice.

posted under Linux Tips | No Comments »

Convert .JPGs to PDFs

September5

Sometimes you need to take a pic of a document say, and then put it into a pdf. Here’s how. In Linux.

You’ll need the awesome imagemagick package first. To install it, use..

sudo apt-get install imagemagick

Once that’s in, open a terminal window. Navigate to the folder you have the images in and then just run the command…

convert the_image.jpg the_document.pdf

Got multiple JPGs and need to squeeze all the images into the same pdf?

convert *.jpg the_document.pdf

Need to reduce the images to 1024 pixels across by whatever down and strip out meta data in the JPG files first though? Fer security and confidentiality?

mogrify -strip -resize 1024x *.JPG

“Nice one centurion, Like it.”

posted under Linux Tips | No Comments »

See a file without comments..

September22

Configuration files often come with a lot of commentary. Documentation is always good, but sometimes you just want the red meat. Here’s how to see a file without all the ‘#’ commentary.

grep ^[^#] /etc/someconfig.conf

Golden.

posted under Linux Tips | No Comments »

Your IP Address

September17

You appear to be coming from the ip address below..

18.216.186.164

Reset user home directory permissions

September15

Simple. Fire these commands to reset your user and also secure their gpg keys / files as well.  The user name will be substituted automatically.

sudo chown -R $USERNAME:$USERNAME /home/$USERNAME
sudo find ~ -type f -print0 | xargs -0 chmod 0640
sudo find ~ -type d -print0 | xargs -0 chmod 0750
sudo chmod 600 ~/.ssh/id_rsa
sudo chmod 740 ~/Desktop/*.desktop
sudo chmod 600 ~/.gnupg/*
sudo chmod 700 ~/.gnupg
posted under Linux Tips | No Comments »

How do I downsize a Hi-Def movie?

August22

In Debian / Ubuntu, use avconv.

avconv -i input.mp4 -b 64k -s hd720 -strict experimental output.mp4

This command uses avconv, where..

-i input.mp4 = the input file name
-b 64k = down sample the audio channel to 64k – should be fine.
-s hd720 = reduce the video from hd1020 to the 720 format
-strict experimental = Allows mp4 output
output.mp4 = the output file.

If you haven’t got avconv installed, use

sudo apt-get install avconv

and follow instructions.

posted under Linux Tips | No Comments »
« Older EntriesNewer Entries »

This is my website for short blog posts and interesting materials that are noteworthy or have some handy-tip value.