- 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
#include <QGlobal.h> | |
#include <QTime> | |
int QMyClass::randInt(int low, int high) | |
{ | |
// Random number between low and high | |
return qrand() % ((high + 1) - low) + low; | |
} | |
// Create seed for the random |
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
//DNS Query Program on Linux | |
//Author : Silver Moon (m00n.silv3r@gmail.com) | |
//Dated : 29/4/2009 | |
//Header Files | |
#include<stdio.h> //printf | |
#include<string.h> //strlen | |
#include<stdlib.h> //malloc | |
#include<sys/socket.h> //you know what this is for | |
#include<arpa/inet.h> //inet_addr , inet_ntoa , ntohs etc |
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
#include "stdio.h" | |
#include "sys/socket.h" | |
#include "errno.h" | |
#include "netdb.h" | |
#include "string.h" | |
#include "stdlib.h" | |
int main(int argc , char **argv) | |
{ | |
struct hostent *host; |
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
''' | |
Syn flood program in python using raw sockets (Linux) | |
http://www.binarytides.com/python-syn-flood-program-raw-sockets-linux/ | |
Silver Moon (m00n.silv3r@gmail.com) | |
''' | |
# some imports | |
import socket, sys | |
from struct import * | |
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
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <netinet/tcp.h> | |
int enableKeepAlive = 1; | |
int fd = tcpSocket->socketDescriptor(); | |
setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &enableKeepAlive, sizeof(enableKeepAlive)); | |
int maxIdle = 300; | |
setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &maxIdle, sizeof(maxIdle)); |
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
/* | |
Packet sniffer using libpcap library | |
*/ | |
#include<pcap.h> | |
#include<stdio.h> | |
#include<stdlib.h> // for exit() | |
#include<string.h> //for memset | |
#include<sys/socket.h> | |
#include<arpa/inet.h> // for inet_ntoa() |
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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<sys/socket.h> | |
#include<features.h> | |
#include<linux/if_packet.h> | |
#include<linux/if_ether.h> | |
#include<errno.h> | |
#include<sys/ioctl.h> | |
#include<net/if.h> | |
#include<net/ethernet.h> |
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
/* Copyright (C) 2012-2015 P.D. Buchan (pdbuchan@yahoo.com) | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
NewerOlder