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 | |
# Usage: | |
# First, source this script: | |
# $ source add_public_key.sh | |
# Then, use the function add user: | |
# $ add_public_key john 'ssh-rsa very-long-hash' | |
add_public_key() | |
{ |
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 | |
# | |
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN | |
# on a Ubuntu server instance. Tested with 14.04 (Trusty) AND 12.04 (Precise). | |
# With minor modifications, this script *can also be used* on dedicated servers | |
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers. | |
# | |
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN | |
# YOUR AMAZON EC2 INSTANCE STARTS! | |
# |
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 | |
# | |
# Author : N.Hashimoto | |
# E-mail : [email protected] | |
# Description : Verify node joining cassandra multinode cluster, and | |
# send alert if the number of live node is less than the specified number. | |
# | |
# ------------------------------------------------------------ | |
# functions | |
# ------------------------------------------------------------ |
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 | |
# Setup Nagios NRPE on Amazon EC2 (Ubuntu) | |
apt-get update | |
apt-get install -y nagios-nrpe-server nagios-plugins | |
sleep 2 | |
mkdir -p /etc/nagios | |
cat > /etc/nagios/nrpe_local.cfg <<EOF |
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 | |
# Run as root | |
wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add - | |
echo 'deb http://packages.elasticsearch.org/logstashforwarder/debian stable main' | tee /etc/apt/sources.list.d/logstashforwarder.list | |
apt-get update | |
apt-get install -y logstash-forwarder | |
update-rc.d logstash-forwarder defaults |
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 | |
# Restart firewall on OS X 10.9 and 10.10 | |
# This script only works if you already turned on your firewall | |
if /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate | grep 'Firewall is disabled.' > /dev/null | |
then | |
echo 'Firewall is turned off.' >&2 | |
else | |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off && sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on | |
fi |
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
==> 530528_http_-_interface.bilibili.com_playurlappkey=1_cid=792790.dump <== | |
<?xml version="1.0" encoding="UTF-8"?> | |
<video> | |
<result>suee</result> | |
<timelength>1915660</timelength> | |
<framecount>34767313</framecount> | |
<src>400</src> | |
<letv-args><![CDATA[]]]></letv-args> | |
<from><![CDATA[sina]]></from> | |
<durl> |
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
# ldapadd -Y EXTERNAL -H ldapi:/// -f ldap_disable_bind_anon.ldif | |
dn: cn=config | |
changetype: modify | |
add: olcDisallows | |
olcDisallows: bind_anon | |
dn: cn=config | |
changetype: modify | |
add: olcRequires | |
olcRequires: authc |
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
dn: cn=openssh-lpk,cn=schema,cn=config | |
objectClass: olcSchemaConfig | |
cn: openssh-lpk | |
olcAttributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey' | |
DESC 'MANDATORY: OpenSSH Public key' | |
EQUALITY octetStringMatch | |
SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 ) | |
olcObjectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' SUP top AUXILIARY | |
DESC 'MANDATORY: OpenSSH LPK objectclass' | |
MAY ( sshPublicKey $ uid ) |
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/pam.d/common-auth - authentication settings common to all services | |
# | |
# This file is included from other service-specific PAM config files, | |
# and should contain a list of the authentication modules that define | |
# the central authentication scheme for use on the system | |
# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the | |
# traditional Unix authentication mechanisms. | |
# | |
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default. |