- Tim Jones homepage (author of primary textbook, note that book code is only on cdrom with book)
- GNU/Linux Application Programming (1st ed.) by Tim Jones (much of first edition of Jones text on Google Books)
- Beginning Linux Programming (4th ed.) by Matthew and Stones (alternative text, can download code from this site)
- free download of Beginning Linux Programming (4th ed.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# ref | |
# * https://gist.github.com/aleiphoenix/0e886336522c2f41412d | |
# * https://stackoverflow.com/questions/3319521/how-can-i-match-each-proc-net-tcp-entry-to-each-opened-socket | |
# * https://stackoverflow.com/questions/14667215/finding-a-process-id-given-a-socket-and-inode-in-python-3 | |
# read /proc/net/tcp get address port and inode. get pid by checking every sysbol link to this inode in every /proc/<PID>/fd | |
import re | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/ | |
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c | |
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver | |
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception | |
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal | |
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04 | |
# Versions | |
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` |
- Install Notepad++ (check "set as default HTML editor" to replace Notepad in IE).
- Run Notepad++, update its plugins, and install "NppExec" via Plugins, Plugin Manager.
- Enter these scripts for Python debugging:
Press F6 to create a NppExec Execute script, save as "Run Python":
cd "$(CURRENT_DIRECTORY)"
py.exe "$(FILE_NAME)"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
# Author: N0dr4x (n0dr4x@protonmail.com) | |
''' | |
Simple Scapy TCP Session class that provide ability | |
to : | |
- execute the 3-way handshake (eg. connect) | |
- properly close connection (->FIN/ACK, <-FIN/ACK, ->ACK ) | |
- send automatic acknowledgment of received tcp data packet |
Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.
- Uninstall and reinstall the ssh server using the following commands:
sudo apt remove openssh-server
sudo apt install openssh-server
- Edit the
/etc/ssh/sshd_config
file by running the commandsudo vi /etc/ssh/sshd_config
and do the following- Change
Port
to 2222 (or any other port above 1000)
- Change
- Change
UsePrivilegeSeparation
to no
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20968 execve("/usr/sbin/snort", ["snort", "-ilo"], 0x7fffdb9b5900 /* 15 vars */) = 0 | |
20968 brk(NULL) = 0x1c0e000 | |
20968 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
20968 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
20968 openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
20968 fstat(3, {st_mode=S_IFREG|0644, st_size=35094, ...}) = 0 | |
20968 mmap(NULL, 35094, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f848ac5c000 | |
20968 close(3) = 0 | |
20968 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
20968 openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libdumbnet.so.1", O_RDONLY|O_CLOEXEC) = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# yum list \*openssl\* | |
yum install -y openssl098e | |
yum install -y zlib | |
ln -s /usr/lib64/libssl.so.0.9.8e /usr/lib64/libssl.so.0.9.8 | |
ln -s /usr/lib64/libcrypto.so.0.9.8e /usr/lib64/libcrypto.so.0.9.8 | |
ln -s /lib64/libbz2.so.1 /lib64/libbz2.so.1.0 | |
wget https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2 | |
tar -xf pypy-1.8-linux64.tar.bz2 | |
cp -r pypy-1.8 /opt | |
ln -s /opt/pypy-1.8/bin/pypy /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find(key, dictionary): | |
for k, v in dictionary.iteritems(): | |
if k == key: | |
yield v | |
elif isinstance(v, dict): | |
for result in find(key, v): | |
yield result | |
elif isinstance(v, list): | |
for d in v: | |
for result in find(key, d): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
## usage: chmod +x es.py & mv es.py /usr/bin/es | |
## edit file to custom server | |
import os | |
from optparse import OptionParser | |
from urllib2 import urlparse | |
SERVER = "http://127.0.0.1:9200/" | |
METHODS = ["GET", "PUT", "POST", "DELETE"] |
NewerOlder