1 ln -s /usr/home home
2 cd /
3 cp -p menu.lst menu.lst~
4 cd /
5 pw tss
6 passwd tss
7 cd /
8 cd /
9 df -h
10 cd /
11 mc
12 cd /
13 mc
14 uname -a
15 apt-get kernel-source-2.4.27
16 apt-get install kernel-source-2.4.27
17 apt-get update
18 apt-get upgrade
19 apt-get update
20 apt-get upgrade
21 df -h
22 apt-get install kernel-image-2.4.27-2-686
23 cd /
24 df -h
25 cd /
26 uname -a
27 mc
28 cd /
29 shutdown -r now
30 chmod 755 list-apt~lled.sh
31 ./list-apt~lled.sh
32 ./list-apt~lled.sh
33 apt-get --purge remove kernel-image-2.4.27-3-386
34 ./list-apt~lled.sh
35 ./list-apt~lled.sh
36 ./list-apt~lled.sh
37 mv list-apt~lled.sh list-apts-installed.sh
38 ./list-apts-installed.sh
39 locate mysql
40 updatedb
41 locate mysql
42 locate mysql/data
43 locate mysql/mysql
44 ln -s /home/mysql mysql
45 chown mysql:mysql mysql
46 ./list-apts-installed.sh
47 ./list-apts-installed.sh
48 ./list-apts-installed.sh
49 ./list-apts-installed.sh
50 mc
51 cd /
52 cd /
53 mc
54 apt-get install qmail
55 /etc/init.d/qmail start
56 /etc/init.d/qmail stop
57 /etc/init.d/qmail start
58 cd /
59 mc
60 cd /
61 /etc/init.d/qmail start
62 /etc/init.d/qmail stop
63 /etc/init.d/qmail start
64 ping yahoo.com
65 cd /
66 mc
67 ping yahoo.com
68 cd /
69 mc
70 ps -aux | grep qmail
71 ps -aux | grep bind
72 cd /
73 mc
74 cd /
75 mc
76 exit
77 uname -a
78 cd /
79 apt-get update
80 apt-get upgrade
81 apt-get autoclean
82 apt-get autoclean
83 cd /
84 cd /home/tss
85 mc
86 cd /
87 apt-get install apt-show-versions
88 mc
89 cd /
90 apt-get update
91 apt-get upgrade
92 cd /
93 mc
94 mc
95 cd /
96 apt-get --purge remove libapache2-mod-php4
97 apt-get --purge remove php4-common
98 apt-get install php5
99 /etc/init.d/apache2 restart
100 apt-get install libapache2-mod-php5
101 apt-get --purge remove apache-common
102 /etc/init.d/apache2 restart
103 apt-get install php5-apc
104 apt-get install php5-cli
105 apt-get install php5-dev
106 apt-get install php5-gd
107 apt-get install php5-mysql
108 apt-get install php5-pear
109 apt-get install mysql-server-5.0
110 /etc/init.d/apache2 restart
111 /etc/init.d/
112 /etc/init.d/mysql stop
113 cd /
114 apt-get update
115 apt-get update
116 apt-get upgrade
117 cd /
118 /etc/init.d/mysql start
119 /etc/init.d/apache2 restart
120 cd /
121 apt-get autoclean
122 apt-get autoclean
123 apt-get --purge remove exim4-base
124 apt-get --purge remove exim4-config
125 cd /
126 mc
127 shutdown -r now
128 wget http://puzzle.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-2.8.2.4.tar.bz2
129 mv phpinfo.php ..
130 chown root:www-data config.inc.php
131 chmod 640 config.inc.php
132 cd /
133 mc
134 uname -a
135 uptime
136 ping yahoo.com
137 ping gal6.com
138 cd /
139 mc
140 cd /var/www/phpmyadmin
141 touch config.inc.php
142 pico -w config.inc.php
143 mc
144 cd /
145 mc
146 uname -a
147 uptime
148 shutdown -r now
149 grep -R chello *
150 ./list-apts-installed.sh
151 cd /
152 apt-get update
153 ping yahoo.com
154 cd /
155 mc
156 cd /
157 mc
158 ping yahoo.com
159 apt-get update
160 apt-get upgrade
161 apt-get install php5-mysqli
162 /etc/init.d/apache2 restart
163 dpkg-statoverride --list
164 dpkg-statoverride --help
165 dpkg-statoverride --list
166 cd /
167 apt-get update
168 apt-get update
169 apt-get update
170 apt-get upgrade
171 cd /
172 apt-get autoclean
173 cd /
174 mc
175 cd /
176 apt-get autoclean
177 cd /
178 mc
179 df -h
180 mc
181 cd /
182 mc
183 exit
184 cd /
185 mc
186 exit
187 cd /
188 apt-get update
189 apt-get upgrade
190 apt-get update
191 apt-get upgrade
192 apt-get update
193 apt-get upgrade
194 cd /
195 uname -a
196 uptime
197 cd /
198 mc
199 exit
200 cd /
201 apt-get update
202 apt-get upgrade
203 apt-get update
204 apt-get upgrade
205 cd /
206 uname -a
207 uptime
208 exit
To use a here-document to assign an array, one line per element, you might use an approach like this:
@sauces = <<End_lines =~ m/(\S.*\S)/g; normal tomato spicy tomato green chile pesto white wine End_Lines
open my $fh, "foo" or die $!;
local $/;
my $content = <$fh>;
close $fh;
@AoA = (
[ "fred", "barney" ],
[ "george", "jane", "elroy" ],
[ "homer", "marge", "bart" ],
);
print $AoA[2][2]; # bart
$x = "Calvin and Hobbes";
@words = split /\s+/, $x;
while ($x =~ /(\w+)/g) {
print "Word is $1, ends at position ", pos $x, "\n";
}
$IPTABLES -A INPUT -s 60.248.80.238 -j DROP
$IPTABLES -A INPUT -s 65.167.60.74 -j DROP
$IPTABLES -A INPUT -s 67.15.121.19 -j DROP
$IPTABLES -A INPUT -s 69.22.169.151 -j DROP
$IPTABLES -A INPUT -s 80.14.129.19 -j DROP
$IPTABLES -A INPUT -s 81.7.88.137 -j DROP
$IPTABLES -A INPUT -s 82.127.122.15 -j DROP
$IPTABLES -A INPUT -s 83.102.131.30 -j DROP
$IPTABLES -A INPUT -s 134.117.69.20 -j DROP
$IPTABLES -A INPUT -s 147.46.66.97 -j DROP
$IPTABLES -A INPUT -s 150.165.168.31 -j DROP
$IPTABLES -A INPUT -s 155.208.240.133 -j DROP
$IPTABLES -A INPUT -s 210.212.20.142 -j DROP
$IPTABLES -A INPUT -s 219.238.235.188 -j DROP
$IPTABLES -A INPUT -s 220.130.3.60 -j DROP
$IPTABLES -A INPUT -s 221.151.113.26 -j DROP
However we really see the value of this if we use an each construct
$dummy = asort($phonedirectory);
while(list($person) = each($phonedirectory))
{
echo "".$person;
// that next comma is important!
while (list(,$persondetails) = each($phonedirectory[$person])) {
echo " - ".$persondetails;
}
}
Our out put here is:
Fred Binns - 123 Cleveland - 111-222-5555
Jane Roe - 123 Elm - 111-222-4444
John Doe - 123 Main - 111-222-3333
Associative two dimensional arrays can be useful as in this phone book example.
//multidemensional associative array
$phonedirectory=array(
"John Doe" => array("123 Main","111-222-3333"),
"Jane Roe" => array("123 Elm","111-222-4444"),
"Fred Binns" => array("123 Cleveland","111-222-5555")
);
echo $phonedirectory["John Doe"][0]." - ".$phonedirectory["John Doe"][1];
Our output here is: 123 Main - 111-222-3333
Recent Comments