sudo add-apt-repository ppa:gnome3-team/gnome3-staging sudo add-apt-repository ppa:gnome3-team/gnome3
ssh -D 1337 -f -C -q -N user@remote -p 22
- -D 1337 tells ssh to launch a SOCKS server on port 1337 locally.
- -f forks the process into the background.
- -C Turns on compression.
- -q enables “Quiet mode”, since the purpose here is only to tunnel we don’t really care about error output and such.
- -N tells ssh that no commands will be sent (-f complains if we don’t specify this).
- -p specifies what port to use; obviously this is defaulted to 22 so the statement above is pointless, but if you’re a clever fellow you’re probably not running SSH on port 22 🙂
tail -f /var/log/tor/log
ssh-keygen -t rsa -b 4096
I recently started learning pygobject as part of my gsoc project and a major problem that I faced was not having autocomplete working with the gobject-introspection library in pycharm. No matter how much we deny it autocompletion helps us developers in not repetitively referring to documentation and guides and increases productivity at the same time.
Here is a solution for people faced with the same problem. First we need to edit the pyCharm idea.properties file:
- Navigate to the /bin folder.
- Locate the idea.properties file and open it for editing. (Chances are you will need to change the permissions.)
- Edit the line “idea.max.intellisense.filesize=1024” and make the value something like 10000.
- Save it!
- Restart pyCharm.
The above steps were done because all the modules in the Gobject-introspection library are binary modules and we need to generate stubs for it in order to have autocompletion. Gtk.py inside the library is too big for the initial buffer size of pyCharm that is 1024 and hence we increase it.
The next steps are fairly simple:
- Go to any existing pyGobject project or create a new python file and type or locate the following line:
from gi.repository import Gtk
- Take your cursor to “Gtk” and press alt+enter and click on “Generate stubs for binary module”.
- Wait for the processes to finish.
Tada! You will have autocompletion working with Gobject-introspection library. This method can also be used for any other library with a similar problem.
npm config set strict-ssl false npm config set registry "http://registry.npmjs.org/"
import datetime now = datetime.datetime.now() print print "Current date and time using str method of datetime object:" print str(now) print print "Current date and time using instance attributes:" print "Current year: %d" % now.year print "Current month: %d" % now.month print "Current day: %d" % now.day print "Current hour: %d" % now.hour print "Current minute: %d" % now.minute print "Current second: %d" % now.second print "Current microsecond: %d" % now.microsecond print print "Current date and time using strftime:" print now.strftime("%Y-%m-%d %H:%M") print print "Current date and time using isoformat:" print now.isoformat()
Current date and time using str method of datetime object: 2014-09-26 16:34:40.278298 Current date and time using instance attributes: Current year: 2014 Current month: 9 Current day: 26 Current hour: 16 Current minute: 34 Current second: 40 Current microsecond: 278298 Current date and time using strftime: 2014-09-26 16:34 Current date and time using isoformat: 2014-09-26T16:34:40.278298
import datetime print datetime.datetime.now() print datetime.datetime.now() - datetime.timedelta(minutes=2) print datetime.datetime.now() - datetime.timedelta(seconds=10) print datetime.datetime.now() - datetime.timedelta(milliseconds=400)
el@dev ~ $ python test.py 2014-11-26 06:47:07.179411 2014-11-26 06:45:07.179538 2014-11-26 06:46:57.179581 2014-11-26 06:47:06.779614