$ps aux | grep nautilus jeffrin 3412 0.4 2.4 839692 96464 ? Sl 18:45 0:12 /usr/bin/nautilus –gapplication-service jeffrin 4714 0.0 0.0 12904 1064 pts/1 S+ 19:35 0:00 grep nautilus $kill -TERM 3412 $ps aux | grep nautilus jeffrin 4722 0.0 0.0 12904 1012 pts/1 S+ 19:36 0:00 grep nautilus $
Monthly Archives: March 2018
Calling an external command in Python
$pwd /home/jeffrin/beautifulwork/github $ls beautifulwork-github.php beautifulwork-github.py $ls -l total 8 -rw-r–r– 1 jeffrin jeffrin 414 Dec 10 2016 beautifulwork-github.php -rw-r–r– 1 jeffrin jeffrin 1300 Dec 10 2016 beautifulwork-github.py $cat ../../ls.py from subprocess import call call([“ls”, “-l”]) $python ../../ls.py total 8 -rw-r–r– 1 jeffrin jeffrin 414 Dec 10 2016 beautifulwork-github.php -rw-r–r– 1 jeffrin jeffrin 1300 Dec 10 …
grep a file, but show several surrounding lines?
$grep -C 1 lambda doowli.py request = urllib2.Request(url) request.get_method = lambda : ‘HEAD’ try: $grep -B 1 -A 0 lambda doowli.py request = urllib2.Request(url) request.get_method = lambda : ‘HEAD’ $grep -B 1 -A 5 lambda doowli.py request = urllib2.Request(url) request.get_method = lambda : ‘HEAD’ try: response = urllib2.urlopen(request) return True except urllib2.HTTPError: return False $grep …
Continue reading “grep a file, but show several surrounding lines?”
libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input driver
https://www.freedesktop.org/wiki/Software/libinput/