Simple Perl variables are called scalars
. Examples of scalar values are
$number = 123;
$string = "String";
$file_handle = open "<filename";
$null_value = undef;
$instance = MyClass->new;
#!/usr/bin/perl -w | |
############################################################################## | |
## | |
## Written by: Jared Cheney <[email protected]> | |
## | |
## Original Template written by: | |
## Brandon Zehm <[email protected]> and Jared Cheney <[email protected]> | |
## | |
## License: | |
## |
# Unpack | |
gzip -cd /boot/initramfs.example | cpio -i | |
# Repack | |
find . | cpio --dereference -o -H newc | gzip > /boot/initramfs.example |
# SNAKES GAME | |
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting | |
import curses | |
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN | |
from random import randint | |
curses.initscr() | |
win = curses.newwin(20, 60, 0, 0) |
# | |
# NB : this is not secure | |
# from http://code.activestate.com/recipes/266586-simple-xor-keyword-encryption/ | |
# added base64 encoding for simple querystring :) | |
# | |
def xor_crypt_string(data, key='awesomepassword', encode=False, decode=False): | |
from itertools import izip, cycle | |
import base64 | |
if decode: |
" VIM Configuration File | |
" Description: Optimized for C/C++ development, but useful also for other things. | |
" Author: Gerhard Gappmeier | |
" | |
" set UTF-8 encoding | |
set enc=utf-8 | |
set fenc=utf-8 | |
set termencoding=utf-8 | |
" disable vi compatibility (emulation of old bugs) |
rsync (Everyone seems to like -z, but it is much slower for me)
#!/usr/bin/python | |
""" | |
dnsSquirrel.py: Simple DNS sniffer based on dnssnarf.py which outputs data in bind log | |
format for further analysis with more advanced tools | |
""" | |
from datetime import datetime | |
import logging | |
from scapy.all import * |
#!/usr/bin/python | |
""" | |
Produces a Linux Netfilter u32 rule to match DNS requests for a given | |
domain name and/or a given query type. | |
Typical usage: | |
% python generate-netfilter-u32-rule.py --qname ripe.net --qtype ANY | |
Can be embedded in iptables' invocations for instance: | |
rule=$(python generate-rule.py args...) |
/* --- Usage --- */ | |
g++ server.c -o server | |
g++ client.c -o client | |
./server | |
./client 127.0.0.1 | |
/* --- server.c --- */ | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> |