How to access your raspberry using SSH ?

if you want to access the Pi using SSH,in the first place you need to get your SSH server enables using Raspi-config.
sudo raspi-config

after that you need to get your RaspberryPI IP . you can easily get that by typing

ip addr | grep ‘inet .* eth0’

lets say that you got this result from the command above :

inet 192.168.2.109/24 brd 192.168.2.255 scope global eth0

now you can start SSH from the command line, passing it the Pi user’s IP address. you will be asked to enter user’s password

ssh pi@192.168.2.109

Convert date to UNIX time stamp

lets start off with getting to know what is Unix time stamp.
UNIX time stamp is a way to track time in seconds, the tracking start from 01-01-1970.
in ServiceNow,sometimes we are in need for this kind of format especially in integration tasks . the function below would make it easy to convert glide date to UNIX time stamp 🙂
function ConvertToUnix(passdate){
// Import Java Date Class
var Date = Packages.java.util.Date;
//get glide date object
var gdt =passdate.getGlideObject();
// create instance from date object . pass date as milliseconds . getNumericValue() would do the job
var date = new Date(gdt.getNumericValue());
// getTime converts date to unix time stamp
var diff = date.getTime();
// return unix time stamp
return diff;
}

GlideDate to ISO 8601

as i start this article, i have a confusion to say . i really hate working with date:).however,if you are dealing a lot with custom integration you probably notice that working with date in ServiceNow is more a complex.
in some cases, like for example sending date in SOAP Message, you need to follow ISO-8601 standard . The example below,shows how to convert GlideDate to  ISO 8601 with two different format

2014-09-02T11:28:56+00:00
2014-09-02T11:28:56Z
Continue reading →