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
package main | |
import ( | |
"encoding/json" | |
"log" | |
"net/url" | |
"os" | |
"os/signal" | |
"github.com/gorilla/websocket" |
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
0xbA7e0FF2d914880bf11FfAE170b64defcAB9c96a |
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 | |
ssl_expiration_date=`openssl s_client -connect $1:443 < /dev/null 2> /dev/null | openssl x509 -text | grep Not | grep -v Before | awk '/Not After : / {print $4, $5, $6, $7, $8}'` | |
expiration_second=`date +%s --date="$ssl_expiration_date"` | |
now_second=`date +%s` | |
((diff_second=expiration_second-now_second)) |
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
package main | |
import ( | |
"fmt" | |
"github.com/zenazn/goji" | |
"github.com/zenazn/goji/web" | |
"net" | |
"net/http" | |
"net/http/fcgi" | |
"os" |
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
private static boolean isAppOnForeground(Context context) { | |
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); | |
List<ActivityManager.RunningAppProcessInfo> appProcesses = activityManager.getRunningAppProcesses(); | |
if (appProcesses == null) { | |
return false; | |
} | |
final String packageName = context.getPackageName(); | |
for (ActivityManager.RunningAppProcessInfo appProcess : appProcesses) { | |
if (appProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND && appProcess.processName.equals(packageName)) { | |
return true; |
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
FROM centos | |
MAINTAINER myaaaaa | |
#Install Packages | |
RUN yum update -y | |
RUN yum install -y passwd openssh openssh-server openssh-clients sudo | |
# Root password | |
RUN echo "root:rootroot" | chpasswd |
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/bash | |
PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` | |
#. $PROGPATH/utils.sh | |
# Default values (days): | |
critical=30 | |
warning=60 | |
whois="/usr/bin/whois" |
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
- hosts: [web-server] | |
vars: | |
src_dir: '/usr/local/src' | |
libevent_src_dir: "$src_dir/libevent" | |
libevent_version: "2.0.21" | |
libevent_src_url: "https://github.com/downloads/libevent/libevent/libevent-$libevent_version-stable.tar.gz" | |
libevent_dir: "libevent-$libevent_version-stable" | |
memcached_src_dir: "$src_dir/memcached" |
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
- hosts: [web-server] | |
vars: | |
src_dir: "/usr/local/src" | |
php_src_dir: "$src_dir/php" | |
php_version: "5.5.4" | |
php_src_url: "http://jp1.php.net/distributions/php-$php_version.tar.gz" | |
tasks: | |
- name: "remove installed package" | |
yum: name=php state=absent |
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
/etc/init.d/mysql start |
NewerOlder