30 marzo 2015

How to setup Wi-Fi dongle on Raspberry Pi

Hi,
in order to enable the wi-fi dongle it’s necessary follow these steps:

  1. Edit the file “interfaces”:

    sudo nano /etc/network/interfaces

    add the follow strings

    allow-hotplug wlan0
    iface wlan0 inet dhcpwpa-conf /etc/wpa_supplicant/wpa_supplicant.confiface default inet dhcp
    below the screeshot:

  2. Edit the file “wpa_supplicant.conf” with the command:

    sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
    Add the follow strings

    network={
    ssid="YOURSSID"

    psk="YOURPASSWORD"

    # Protocol type can be: RSN (for WP2) and WPA (for WPA1)

    proto=WPA

    # Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)

    key_mgmt=WPA-PSK

    # Pairwise can be CCMP or TKIP (for WPA2 or WPA1)

    pairwise=TKIP

    #Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)

    auth_alg=OPEN

    }

    below the screeshot:
  3. When editing files is done, is the time to run the command: sudo reboot .Immediately after run the command,  unplug the Ethernet cable and plug in the Wi-Fi dongle.

Bye
Francesco

How to: Change root password in raspberry pi (in a general linux)

Hi,
it’s very simple changing the root password in every Linux with the command “passwd root”.
For do this it’s necessary having the rights and be a sudoers member.
In the screenshot below I used the pi user:


Bye
Francesco

7 marzo 2015

How-to: Clone Raspberry Pi SD Card


  1. Open the application Win32DiskImager (probably you have used it during the first installation)

  2. In the "Image File" textbox, enter the path of the image file. For example, I put c:\temp\clone_raspberry_20131115.img
  3. In the "Device" combobox, select the letter of your SD card reader.
  4. Click the "Read" button to create the image file from your card.
Enjoy it!

Who users are connected or login to Oracle applications?

It give the number of session users on the system in the past 1 hour:

select "is".user_id, user_name, description, email_address,  to_char(min(first_connect) ,  'DD-MON-YYYY HH24:MI:SS') min_first_connect, to_char(max(last_connect),'DD-MON-YYYY HH24:MI:SS') max_last_connect,count(*) "# sessions"
from apps.icx_sessions "is"
inner join apps.fnd_user fu on fu.user_id = "is".user_id
where  last_connect > sysdate - 1/24 and "is".user_id != '-1'
group by "is".user_id, user_name, description, email_address;

This return the user login into system with at least a session and a process:

select d.user_id, d.user_name, d.description, d.email_address, a.terminal_id, b.machine, to_char(a.start_time,  'DD-MON-YYYY HH24:MI:SS') start_time
from apps.fnd_logins a,
v$session b, v$process c, apps.fnd_user d
where b.paddr = c.addr
and a.pid=c.pid
and a.spid = b.process
and d.user_id = a.user_id
and (d.user_name = 'USER_NAME' OR 1=1);

Enjoy it!

6 marzo 2015

How to create a tar file encrypted with gpg in linux

First step is to create a script for the compression + encryption. You could to call it for instance: “encrypt”.

#!/bin/bash
  tput sc
  while [ -s $pass ] || [ $pass '!=' $pass2 ]; do
   read -s -p "Enter Passphrase: " pass;
   tput rc;
  read -s -p "Re-Enter Passphrase: " pass2;
   tput el1;
   tput rc;
  done;

  for file in $@; do
   tar -cf - $file | gpg -c --passphrase $pass > $file.gpg;
   srm $file;
  done

Next, if you want decrypt a file will be necessary to run another script defined as:

#!/bin/bash
  tput sc;
  while [ -s $pass ]; do
   read -s -p "Enter Passphrase: " pass;
   tput el1;
   tput rc;
  done;

  for file in $@; do
    tar -xf <(cat $file | gpg -d --passphrase $pass);
    if [ $? -eq 0 ]; then
      srm $file;
    else
      echo Failed to Decrypt;
      echo [password might be wrong];
    fi;
  done;

Finally, after the script definitions, you could run when you wish encrypt or decrypt a file:

encrypt filename
decrypt filename

Enjoy it!