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 -e | |
# | |
# Raspberry PI password recovery for arch | |
# The SD should be mounted on $DEV (usually sdb2) | |
USER=root | |
PASSWORD=hola | |
DEV=sdb2 | |
# Creating SHA512 password for arch |
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 | |
# requires hashlimit | |
iptables -I INPUT -p tcp -m tcp --dport 22 -m state --state NEW \ | |
-m hashlimit --hashlimit 1/min \ | |
--hashlimit-burst 5 --hashlimit-mode srcip \ | |
--hashlimit-name SSH --hashlimit-htable-expire 120000 \ | |
-j ACCEPT | |
iptables -I INPUT -p tcp -m tcp --dport 22 \ |
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
Warning!! Unsupported GPT (GUID Partition Table) detected. Use GNU Parted | |
To go back to the normal MBR: | |
# parted /dev/sda | |
# mklabel msdos | |
# quit | |
Or, do it in a single line: | |
# parted -s -- /dev/sda mklabel msdos |
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 | |
dev=$1 | |
ping -c 1 -I $dev ifconfig.me && \ | |
echo "Public ip: $(curl -s --interface $dev ifconfig.me/host) $(curl -s --interface $dev ifconfig.me/ip)" |
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 bash | |
# | |
# Script to connect to remote machine via ssh and export X11 via vnc using a ssh tunnel | |
# | |
# Author: Jose Riguera <jriguera@gmail.com> December 2009 | |
# License: GNU General Public License v2 or later | |
# | |
# x11vnc must be installed on remote host | |
# xvnc4viewer must be installed on local host | |
# |
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 | |
TENANT=cf | |
PASSWORD=cf | |
TENANT_DESC="Cloud Foundry" | |
TENANT_EMAIL="cloud-foundry@springer.com" | |
TENANT_NET="10.0.1.0/24" | |
TENANT_NET_GW="10.0.1.1" | |
export OS_USERNAME=admin |
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
import java.io.ByteArrayInputStream; | |
import java.io.File; | |
import java.util.List; | |
import com.amazonaws.auth.AWSCredentials; | |
import com.amazonaws.auth.BasicAWSCredentials; | |
import com.amazonaws.util.StringUtils; | |
import com.amazonaws.services.s3.AmazonS3; | |
import com.amazonaws.services.s3.AmazonS3Client; | |
import com.amazonaws.services.s3.model.Bucket; | |
import com.amazonaws.services.s3.model.CannedAccessControlList; |
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 bash | |
download() { | |
local url="$1" | |
local destin="$2" | |
echo -n " " | |
if [ ! -z "${destin}" ]; then | |
wget --progress=dot "${url}" -O "${destin}" 2>&1 | grep --line-buffered "%" | \ | |
sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' |
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
# To control the way the scheduler select the host where running a vm: | |
# Default value is 1.0, negative means that will pack vms on one host | |
ram_weight_multiplier = -1.0 | |
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
root@node-11:~# nova hypervisor-list | |
+----+--------------------------+ | |
| ID | Hypervisor hostname | | |
+----+--------------------------+ | |
| 3 | node-8 | | |
| 6 | node-12 | | |
| 9 | node-15 | | |
+----+--------------------------+ | |
OlderNewer