Wednesday, October 30, 2013

Debian Wheezy repositories

Example of a default-starting sources.list content

deb http://http.debian.net/debian wheezy main
deb-src http://http.debian.net/debian wheezy main

deb http://http.debian.net/debian wheezy-updates main
deb-src http://http.debian.net/debian wheezy-updates main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

Bye..

Monday, October 28, 2013

Debian Wheezy: resize/scale images from command line.

First of all you need to have installed imagemagick.
If no, install it from terminal as root so:

apt-get install imagemagick

Now you are ready to convert input.jpg file into output.jpg file for a 1000 pixels of width and 500 pixels of height....

convert -scale 1000x500 input.jpg output.jpg 

The scale method, in this case, depends of the height and the weight of your image.
So if your image is 2 pixels of width and 1 pixels of height the perform will gone exactly.

Differently the perform will be approximated.

If you want to force the scale performing to make a image of gived dimensions...

convert -scale 1000x500! input.jpg output.jpg

If you have multiple files to convert use this:

for i in $( ls *.JPG); do convert -resize 1300x500 $i $i; done
 
Bye.

Wednesday, October 23, 2013

Debian Wheezy: mounting windows shared folder

First of all install cifs-utils smbclient packets, to browse and mount net folders..
So from command line:
apt-get install smbclient cifs-utils

Then you need to create a local folder to map remote folder
mkdir /home/username/example_folder

Then you can mount the remote folder by executing this:
mount -t cifs -o username=remote_pc_username //remote_pc_ip_address/remote_folder_shared_name /home/username/example_folder

Where:
remote_pc_username is the username of remote pc
remote_pc_ip_address is the remote ip address
remote_folder_shared_name is the name that the shared folder has into the local net.

Example 2:
mount -t cifs -o username=pippo //192.168.1.2/shared /home/pluto/example_folder


Terminal will prompts to you the password request....
Give it and then you will have correctly mapped your remote folder into your local example_folder


Bye..


Wednesday, October 16, 2013

Freepops under Debian Wheezy 7.0.1

Freepops is a free for use software that give you the capability to open a gateway to remote resources with pop3 protocol. 

From terminal, as root, install freepops

apt-get install freepops


After, you make under /bin two files.......
The file  freepopsd_start.sh contains:
#!/bin/bash
freepopsd &


And the file  freepopsd_stop.sh contains:
#!/bin/bash
freepopsd -k &




Now from command line of your current user you can give those commands to startup or shutdown the "tunnel".... 

Often before you run you email client...

Bye.... 

Linux: search a file

Simply and fast..... if you are searching a file that you have absolutely forget the path, you can run this by terminal:

locate yourfilename.txt

Important: locate use an indexed system of file research.
For mantains this system update you have to execute periodically this command from terminal....

updatedb

Bye..

Tuesday, October 8, 2013

Debian Wheezy 7.1: quick samba setup

From command line

apt-get install samba smbclient


during installation, it performs default configuration
after....
 
adduser guest --home=/home/public --shell=/bin/false --disabled-password

to create a guest user to use only as samba default user...

chmod -R 0700 /home/public
chown -R guest.guest /home/public
 
These commands configure the sharing in way of every user can create a content(file or folder)
into the shared folder.
No one may edit the content created by someone others.... 
If you want some of differently, change the permission mask.....
Now edit /etc/samba/smb.conf
adding after the row obey pam restrictions = yes
 
insert these rows: 
 
guest account = guest
invalid users = root

 
and in the *Authentication* section,  this row.....: 
 
security = share

In the sharing section add:
# SHARED DIR
[shared]
   comment = shared
   read only = no
   path = /home/public
   guest ok = yes
   guest only = yes
   create mask = 0600
   directory mask = 0700

 
Fine...... restart samba:
 /etc/init.d/samba restart

and all is done.....

Bye...

Thursday, October 3, 2013

Linux: how to check ram usage

This is quickly command to check ram available on you system...
From terminal execute:

free -k

This command extract info from the /proc/meminfo file.
So if you open this file you see a complete set of information about your system memory.

Bye..

Linux: symbolic link(shortcut) from terminal

From terminal exceute:

ln -s /full_path_whereyouwanttopoint /full_path_alias_command_name

Bye...