Archive for Uncategorized

Slightly more advanced uses of find for finding files between two dates/times

I’ve used find commands before and talked about them on Unixsupport.com, however I recently needed to stack a few find commands and found it less then easy to search out support… so:

find . \( -ctime +1 -not -ctime +3 \) | xargs -I{} ls -l {}

find files, in the current directory, that were created more then 1 day ago, not, more then 3 days ago, then send them over to ls to show them to me

Comments

Quick test of TCP between firewalls with Netcat

So sometimes I’m on a box and need to test if a port is cleared on a firewall.. i may not yet have apache installed but I want to test if port 80 is open, or I may want to act as a server to grab a request..

simple with Netcat.

nc -l -p 8080

will open a listen on port 8080 and after the first connect, exit and go back to shell… useful for testing

Comments

Quickly create files of a specific size for tests

Sometimes I’ve had to create files to test transfer speeds between points.. sure you could transfer that 650 meg iso image of freebsd, or you could create a “blank” file..

dd if=/dev/zero of=linux.ex2 bs=1024 count=131072

creates 128mb blank file

dd if=/dev/random of=linux.ex2 bs=1024 count=131072

creates 128mb file with random characters in it

for example.. play around with the count numbers in bytes and your set.

Comments

Netmask Table

255.255.255.255       11111111.11111111.11111111.11111111    /32          Host (single address)
	
255.255.255.254       11111111.11111111.11111111.11111110    /31          Unusable
255.255.255.252       11111111.11111111.11111111.11111100    /30            4 IPs with   2 Usable
255.255.255.248       11111111.11111111.11111111.11111000    /29            8 IPs with   6 Usable
255.255.255.240       11111111.11111111.11111111.11110000    /28           16 IPs with  14 Usable
255.255.255.224       11111111.11111111.11111111.11100000    /27           32 IPs with  30 Usable
255.255.255.192       11111111.11111111.11111111.11000000    /26           64 IPs with  62 Usable
255.255.255.128       11111111.11111111.11111111.10000000    /25          128 IPs with 126 Usable
255.255.255.0         11111111.11111111.11111111.00000000    /24         256 IPs with  254 Usable 
                                                                                *”Class C”*
	
255.255.254.0         11111111.11111111.11111110.00000000    /23         
255.255.252.0         11111111.11111111.11111100.00000000    /22         
255.255.248.0         11111111.11111111.11111000.00000000    /21         
255.255.240.0         11111111.11111111.11110000.00000000    /20         
255.255.224.0         11111111.11111111.11100000.00000000    /19         
255.255.192.0         11111111.11111111.11000000.00000000    /18         
255.255.128.0         11111111.11111111.10000000.00000000    /17         
255.255.0.0           11111111.11111111.00000000.00000000    /16         
                                                                                *”Class B”*            
	
255.254.0.0           11111111.11111110.00000000.00000000    /15         
255.252.0.0           11111111.11111100.00000000.00000000    /14         
255.248.0.0           11111111.11111000.00000000.00000000    /13         
255.240.0.0           11111111.11110000.00000000.00000000    /12         
255.224.0.0           11111111.11100000.00000000.00000000    /11         
255.192.0.0           11111111.11000000.00000000.00000000    /10         
255.128.0.0           11111111.10000000.00000000.00000000    /9          
255.0.0.0             11111111.00000000.00000000.00000000    /8       
                                                                                *”Class A”*    
	
254.0.0.0             11111110.00000000.00000000.00000000    /7         
252.0.0.0             11111100.00000000.00000000.00000000    /6         
248.0.0.0             11111000.00000000.00000000.00000000    /5         
240.0.0.0             11110000.00000000.00000000.00000000    /4         
224.0.0.0             11100000.00000000.00000000.00000000    /3         
192.0.0.0             11000000.00000000.00000000.00000000    /2         
128.0.0.0             10000000.00000000.00000000.00000000    /1         
0.0.0.0               00000000.00000000.00000000.00000000    /0    
                                                                                *IP space*
	
*Note:* The first and last IP of a series are *NOT* usable and the first  
usable IP is normally set up for the router.
The 1st IP is the network address. The last IP is the broadcast address.
=====================================================================

Comments

Welcome to UnixSupport.com

We’re just getting things ramped up, however if you have any questions feel free to send an email to questions (a-@-t) unixsupport.com and we’ll try and answer them!

Comments