This file contains 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/env python | |
import ssl | |
import OpenSSL.crypto | |
cert = ssl.get_server_certificate(('www.google.com', 443)) | |
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert) | |
print x509.get_notAfter() |
This file contains 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 | |
export JAVA_HOME="/opt/java/java7/" | |
export PATH="$PATH:$JAVA_HOME/bin" | |
echo "Downloading tzupdater" | |
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/tzupdater/2.0.0/tzupdater-2_0_0-2015a.zip | |
# wget http://java-runtime.ru/d/tzupdater-2.0.0-2015a.zip | |
unzip tzupdater-2_0_0-2015a.zip | |
cd tzupdater-2.0.0-2015a |
This file contains 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/python | |
# -*- coding: utf-8 -*- | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
from os import curdir, sep | |
PORT_NUMBER = 8000 | |
class myHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
This file contains 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 | |
# From The Logstash Book | |
# The original of this file can be found at: http://logstashbook.com/code/index.html | |
# | |
### BEGIN INIT INFO | |
# Provides: logstash | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog |
This file contains 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 | |
# From The Logstash Book | |
# The original of this file can be found at: http://logstashbook.com/code/index.html | |
# | |
### BEGIN INIT INFO | |
# Provides: logstash | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog |
This file contains 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 | |
### BEGIN INIT INFO | |
# Provides: skeleton | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |
This file contains 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/env python | |
""" nohup ./lockunlock.py &""" | |
import os | |
import sys | |
import time | |
def LockUnlock(line): | |
str_conn = "Device added: sysfs-LGE-Nexus_5" |
This file contains 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/env python | |
# 1. | |
def recur(list): | |
if len(list) == 1 : | |
return str(list.pop()) | |
else: | |
return str(list.pop()) + "\n" + recur(list) | |
mylist = ['1','2','3','4','5','6'] |