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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#include <jansson.h> |
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 -x | |
## original author: Oliver Nassar <onassar@gmail.com> | |
## credit: harmy <hack4cn@gmail.com> | |
## Ubuntu VPN for poor Chinese (you know de) | |
## Sample Usage: | |
## | |
## wget https://gist.github.com/raw/3891178/ff1702fac175eb21c513b93f51f39948be693aba/vpn-setup.sh | |
## chmod +x vpn-setup.sh | |
## sudo ./vpn-setup.sh <username> <password> |
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
sudo dd if=/dev/zero of=/swap bs=1G count=16 | |
sudo chmod 0600 /swap | |
sudo mkswap -f /swap | |
sudo swapon /swap | |
echo "sudo vim /etc/fstab" |
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 | |
# Specify the desired volume size in GiB as a command-line argument. If not specified, default to 20 GiB. | |
SIZE=${1:-20} | |
# Install the jq command-line JSON processor. | |
sudo yum -y install jq | |
# Get the ID of the envrionment host Amazon EC2 instance. | |
INSTANCEID=$(curl http://169.254.169.254/latest/meta-data//instance-id) |
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
head -c 12 /dev/urandom | base64 |
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
aws stepfunctions list-executions --state-machine-arn arn:aws:states:us-east-1:415293337666:stateMachine:cpi-prod-install --status-filter RUNNING|jq '.executions[].executionArn'|xargs -L 1 aws stepfunctions stop-execution --execution-arn |
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
*/3 * * * * sudo ruby /usr/bin/haproxy-autoscaling-update.rb |
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 python3 | |
import sys | |
import time | |
import csv | |
import json | |
from collections import namedtuple | |
from elasticsearch import Elasticsearch | |
from elasticsearch.helpers import bulk | |
ES_ENDPOINT = 'vpc-xxxxxxxxxxxx.us-east-1.es.amazonaws.com:80' |
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
PUT _template/default | |
{ | |
"template": "*", | |
"settings": { | |
"number_of_shards": 3 , | |
"number_of_replicas": 0 | |
}, | |
"mappings": { | |
"_default_": { | |
"_all": { |
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
# oxTrust is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. | |
# Copyright (c) 2014, Gluu | |
# | |
# Author: Jose Gonzalez | |
# | |
from org.xdi.model.custom.script.type.scim import ScimType | |
from org.xdi.util import StringHelper, ArrayHelper | |
from java.util import Arrays, ArrayList | |
from org.gluu.oxtrust.ldap.service import GroupService | |
from org.gluu.oxtrust.ldap.service import PersonService |
NewerOlder