sábado, 10 de setembro de 2016

How setup hidden SSID on Raspberry PI

This article show how configure interface wlan to connect hidded SSID,we go edit only the file interface on directory /etc/network.
Now open your favorite editor for configuring the file interfaces, follow the path /etc/network/interfaces. Is a good ideia make backup this archive, because if wrong edit, you go have problem for connect your network. After you make backup, edit the last line:
 auto wlan0
allow-hotplub wlan0
iface wlan0 inet dhcp
      wpa-ssid "your SSID"
      wpa-psk "Your password for connect to network"
Now reboot your raspberry PI and check your ip in wlan. 

quinta-feira, 28 de abril de 2016

Schedule tasks on Linux

Is possible execute schedule task on Linux, for this we use the command cron or at. This post I will show how task schedule in your Linux.

Working the Cron

 No doub the cron is very utilized for Linux administrator. Your interface is very simples, we will look your functions! Just open the terminal and type command:

crontab -e

Sometimes the terminal will ask to use a text editor, select your favorite editor.

See contrab configuration:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command

Look the last lines having: m h dom mon dow comand

Means

m------------------> Minutes 00 59
h ------------------> Hours 00 23
dom--------------> Month day 1 31

mon -------------> Month 1 12
dow-------------->Week day 0 7
command ----> Command to execute task

Use * to specify every minutes, days, month and etc.

Examples, we go configure task the a script for incremental backup every day at 9PM.

# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command

  00  21 *       *      *       /home/youruser/incremental\ backup.sh

Now every day at 9PM the cron run the script incremental backup.

Working the At

The command at is usefull to perform a task only once, example shutdown your computer.
The command At.

at HH:mm MM/DD/YYYY

Example on terminal

use@yourpc:$ at 20:00
at> shutdown -r now

press ctrl+d for save the task

For look the task scheduled type:

atq

For remove the task scheduled type:

atrm



segunda-feira, 25 de abril de 2016

Checking your file system with fsck

In some case, the file system may experience problems, we can fix with the fsck. Make backup the files on partition with problem, you can create a image the disk our copy the files for other media.
This example we go utilize the partition /dev/sda5, now we go umount the partition with command umount.

sudo umount /dev/sda5

now type the command:

sudo fsck /dev/sda5

wait the fsck terminate the task.

Do not utilize the command for Windows file system, for this utilize the own Windows.
Never run the command with partition mounting, can corrupt the files.

terça-feira, 19 de abril de 2016

How install nvidia drivers on Ubuntu




This post i will show install Nvidia native drivers.

first click on dash or use Windows key on keyboard, type "Software & Updates", click in additional Drivers, wait the system search drivers. Select driver for your card video. Always prefer binary drivers propreitary and tested

segunda-feira, 18 de abril de 2016

How to rescue the grub boot load

Sometimes when we have two operational system on hard drive, example Ubuntu and Windows, can errors occur in the boot.
Possible causes.

  • Update on Windows.
  • Upgrade Windows on other version for Windows 10.
  • Configuration boot loader on Windows.
  • Lost boot loader on hard drive 

The correction is simple, requires the Linux installation media installed.

Now you insert the media into the computer you need to fix the boot.

First open the terminal and run command with root.

#fdisk -l


See the partitions on the disk settings:

Disk /dev/sdb: 1000.2 GB, 1000200658432 bytes
255 heads, 63 sectors/track, 121600 cylinders, total 1953516911 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087501

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      976895      487424   83  Linux
/dev/sdb2          976896   196288511    97655808   83  Linux
/dev/sdb3       196290558  1953515519   878612481    5  Extended
/dev/sdb5       196290560   212289535     7999488   82  Linux swap / Solaris
/dev/sdb6       212291584  1953515519   870611968   83  Linux

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc92bea40

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048  1953516911   976757432    7  HPFS/NTFS/exFAT


This example show that partition /dev/sdb1 and /dev/sda1 are partition bootable. See that the partition /dev/sdb1 is my partition the boot on Linux and /dev/sda1 is partition the boot on Windows. Sure how the partition /dev/sda1 is partition primary, we will go record the bootloader the zero track HD. Use this command

#grub-install /dev/sda

Remember that Grub should be installed on the HD track zero,  as I installed Windows first, the zero track is Windows partition.
Be careful not to confuse the live partition on the HD partition, Grub should be applied to HD partition.
An easy way to remember and which the system was first installed in HD, the first partition is where the zero track.





domingo, 17 de abril de 2016

How to access the file server from Windows to Linux

For this, we must know the IP our hostname the Windows File Server, and run the command:

#mount -t cifs -o username=username for access the file server, password= password for access your account on file server //IP our hostname the Windows/share folder /mnt


Now you will go for directory /mnt there is where the access point to the file server.

If you need to access more than one share, just create folders in the /mnt and point the share folder on mount command.

Example:


Assuming that the Windows server has folders: Company data and Human Resources.

Create directory on /mnt

#mkdir /mnt/company\ data
#mkdir /mnt/Human\ Resources

Now will go access Company data, okay?


#mount -t cifs -o username=username for access the file server, password= password for access your account on file server //IP our hostname the Windows/Company\ data /mnt/Company\ data

Now will go access Human Resources, we will repeat the above command replacing the folder 


 #mount -t cifs -o username=username for access the file server, password= password for access your account on file server //IP our hostname the Windows/Human\ Resources /mnt/Human\ Resources

This command works on all distributions.

 

sábado, 16 de abril de 2016

How to start application after user login


This configuration can be applied to all Linux distributions, for this we must edit .profile file that is in the user's home.
Before make the backup the file .profile, we do not want accident, ok!
cp ~/.profile  .profile.bkp

Case need to restore.

cp ~/.profile.bkp .profile

Open and edit the file .profile on home directory the user.
I will use vi for this example, ok?
Example:
user@mypc:~$ vi .profile

well, now insert the name for application, for example Thunderbird the email client native for ubuntu and other distribuition.

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
 

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

thunderbid & #here is aplication for startup
 # if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi



Now save the file.
Okay, now when the user logs into the system, the thunderbird will start.