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
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| my $body = <<"EOM"; | |
| <html> | |
| <head> | |
| <title>title</title> | |
| </head> |
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
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| my $rand_str = get_random_str(10); | |
| print "$rand_str\n"; | |
| sub get_random_str { | |
| my $length = shift; |
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
| UPDATE userinfo SET view_id=LPAD(lower(hex(status)), 5, '0'); | |
| +------------+--------+------------+---------+ | |
| | userid | status | password | view_id | | |
| +------------+--------+------------+---------+ | |
| | a121 | 146 | aaaa | 00092 | | |
| | a122 | 149 | aaaa | 00095 | | |
| | a123 | 150 | aaaa | 00096 | | |
| | a124 | 151 | aaaa | 00097 | | |
| | a125 | 155 | aaaa | 0009b | |
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 <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| int | |
| main() | |
| { | |
| int sock; | |
| struct sockaddr_in addr; |
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
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| use Socket; | |
| my $iaddr = inet_aton("192.168.1.1"); | |
| my $port = 80; | |
| #send_tcp($iaddr, $port); |
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
| # use lib qw(./lib); | |
| # use Packet::Simple; | |
| # my $obj = Packet::Simple->new("192.168.1.2", 50001); | |
| # $obj->send_tcp(); | |
| package Packet::Simple; | |
| use strict; | |
| use warnings; | |
| our $VERISON = '0.01'; |
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/sh | |
| process="/usr/sbin/httpd" | |
| count=$(ps axww -o command | grep "$process" | grep -v grep | wc -l) | |
| if [ $count = 0 ]; then | |
| echo "[ERROR] Process not found: $process" | |
| exit 1 | |
| elif [ $count -lt 1 ]; then | |
| echo "[ERROR] Number of processes are low: $process" |
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/sh | |
| while read hostname | |
| do | |
| { | |
| echo -n ${hostname}, | |
| openssl s_client -connect ${hostname}:443 < /dev/null | openssl x509 -modulus -noout | |
| } >> result.txt | |
| done < hostlist |
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
| #!/usr/bin/perl -w | |
| use strict; | |
| use Jcode; | |
| use Net::SMTP; | |
| use MIME::Base64 qw(encode_base64); | |
| local $/; | |
| my $DEBUG = 0; |
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
| # httpd.conf | |
| # | |
| # Apache -> Tomcat (AJP) sample config. | |
| # ワーカーに重なりがある場合、前方一致で最初にマッチしたルールが勝つ。 | |
| # そのためProxyPassの設定は、「URLが長い順」に書かないといけない。 | |
| # http://httpd.apache.org/docs/2.2/mod/mod_proxy.html | |
| #-- Valid Setting -------------------------------------------------- | |
| ProxyPass /service-test/ balancer://service-test/ |