This file contains hidden or 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
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
public class IPRangeChecker { | |
public static long ipToLong(InetAddress ip) { | |
byte[] octets = ip.getAddress(); | |
long result = 0; | |
for (byte octet : octets) { | |
result <<= 8; |
This file contains hidden or 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 <string.h> | |
#define LOC_MAXLEN 13 | |
int main (void) | |
{ | |
char dest[LOC_MAXLEN]; | |
snprintf(dest, LOC_MAXLEN, "%s%s", "abc", "def"); |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Author: Thiago Cavalcante | |
# github.com/theagoliveira | |
url="http://pages.cs.wisc.edu/~remzi/OSTEP/" | |
mkdir OSTEP | |
cd OSTEP | |
wget -O "00a Preface.pdf" "${url}preface.pdf" |