Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / share / doc / libhtml-template-perl / examples / | server ip : 104.21.89.46 your ip : 172.69.59.104 H O M E |
Filename | /usr/share/doc/libhtml-template-perl/examples/clean_shm.pl |
Size | 516 |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 10:11 |
Last modified | 22-Oct-2013 01:27 |
Last accessed | 27-Apr-2025 10:11 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/usr/bin/env perl
use strict;
use warnings;
# this script deletes all shared memory segments accessible by the
# running user. Probably only works on Linux systems.
open(IPCS, 'ipcs |') or die "Probs opening icps : $!";
my $mode = 0;
while (<IPCS>) {
if (/(Shared)|(Semaphore)|(Message)/) {
$mode++;
next;
}
next unless /^0x[0-9a-f]+\s(\d+)\s.*$/;
system("ipcrm shm $1") if ($mode == 1);
system("ipcrm sem $1") if ($mode == 2);
system("ipcrm msg $1") if ($mode == 3);
}
use strict;
use warnings;
# this script deletes all shared memory segments accessible by the
# running user. Probably only works on Linux systems.
open(IPCS, 'ipcs |') or die "Probs opening icps : $!";
my $mode = 0;
while (<IPCS>) {
if (/(Shared)|(Semaphore)|(Message)/) {
$mode++;
next;
}
next unless /^0x[0-9a-f]+\s(\d+)\s.*$/;
system("ipcrm shm $1") if ($mode == 1);
system("ipcrm sem $1") if ($mode == 2);
system("ipcrm msg $1") if ($mode == 3);
}