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
Verifying my Blockstack ID is secured with the address 1Hyf8RjucfmE6EFzsiKC5Kvfrw9qxr5t2n https://explorer.blockstack.org/address/1Hyf8RjucfmE6EFzsiKC5Kvfrw9qxr5t2n |
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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases. | |
# Much of this was originally copied from: | |
# http://natelandau.com/my-mac-osx-bash_profile/ | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management |
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
First time configuration | |
vi /var/spool/cron/crontabs/root | |
0 */15 * * * /vmfs/volumes/datastore1/auto-poweron.sh | |
vi /vmfs/volumes/datastore1/auto-poweron.sh | |
VMS=$(vim-cmd vmsvc/getallvms | grep -v Vmid | awk '{print $1}') | |
for VM in $VMS ; do | |
PWR=$(vim-cmd vmsvc/power.getstate "$VM" | grep "Powered") | |
if [ "$PWR" == "Powered off" ] ; then | |
vim-cmd vmsvc/power.on $VM |
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
One of the biggest challenges I run into working with ESXi hosts is the lack of a real usable CLI. The remote CLI provided by VMware is clunky at best and makes administration a bit of a pain. I did some poking around and managed to find some interesting CLI commands that work for ESXi. | |
Most of these have no manual page but will output a help message if run by themselves. I would recommend using extreme caution and using a test host to determine the usefulness in your environment before using them on an important system. Also keep in mind that the examples that I give are not the "only" way the commands can be used. | |
To power on a virtual machine from the command line: | |
- Lists all vm's running on hypervisor and provides vmid | |
vim-cmd vmsvc/getallvms | |
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
<?php | |
// Purpose: The edX AMR course textbook had extra large side buttons and very slow loading time, which was really annoying. | |
// For personal use only. | |
// Note: Create a directory ./book before running PHP script. | |
// Example: | |
// mkdir ./book # Create directory | |
// sudo chmod +w./book # Make the book directory writeable | |
// vim amr_textbook.php # Copy paste the following script, save, exit (:wq) | |
// php amr_textbook.php # Execute |
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 | |
baseurl=http://mygitlaburl | |
usermail=adminuser@mymailserver | |
userpass=adminpassword | |
repo_access=2 #0=denied 1=read 2=read&write | |
project_access=2 #0=deined 1=read 2=report 3=admin | |
# login | |
curl -s -I -c cookies.txt -d "utf8=✓&user[email]=$usermail&user[password]=$userpass&commit=Sign+in" $baseurl/users/sign_in |
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
# Gitlab 5.1: https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md | |
# Set up an AWS EC2 Ubuntu 12.04 LTS Server. | |
# Use ap-southeast-1b: spot pricing is smoother | |
# Log in as ubuntu@ | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
# Install the required packages. |
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
#include "ros/ros.h" | |
#include "std_msgs/String.h" | |
void callback(const std_msgs::String &msg) { | |
ROS_INFO("I heard: [%s]", msg.data.c_str()); | |
} | |
int main(int argc, char **argv) { | |
ros::init(argv, argc, "listener"); | |
ros::NodeHandle n; |