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
User.find(id).populate('preferences').exec(function (err, user) { | |
if(err) { | |
sails.log.error("ERR:", err); | |
} | |
sails.services['util'].populateDeep('user', user[0], 'preferences.nestedPreferences', function (err, newUser) { | |
if (err) { | |
sails.log.error("ERR:", err); | |
} | |
console.log(newUser); | |
}); |
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
#!/usr/bin/expect | |
# password first argument , IP second argument | |
set arg1 [lindex $argv 1] | |
set arg2 [lindex $argv 0] | |
set suffix "123!@#" | |
spawn ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 86 ihehaadmin@$arg1 | |
expect "password:" | |
send "$arg2\n"; | |
expect "\[ihehaadmin:" | |
send "passwd\n"; |
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
#!/usr/bin/env bash | |
sudo apt-get install unzip | |
curl -s "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" | |
unzip awscli-bundle.zip | |
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Ember Starter Kit</title> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script> | |
<script src="http://builds.emberjs.com/tags/v1.8.0/ember.js"></script> | |
<style id="jsbin-css"> |
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
#!/usr/bin/env sh | |
MAXRETRY=50 | |
count=0 | |
ping -W3 -c1 www.google.com > /dev/null 2>&1 | |
while [ $? -ne 0 ]; do | |
#statements | |
if [ "$count" = "$MAXRETRY" ]; then | |
echo "No network found outside to Internet" | |
exit 1 |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
CLOUDENGINE_SOURCE = "/home/kithokit/appcara/cloudengine" | |
CLOUDENGINE_DEST = "/root/src/cloudengine" | |
PUPPET_SOURCE = "/home/kithokit/appcara/svn/puppet-manifest" | |
PUPPET_DEST = "/root/src/puppet" |
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
animals = [ | |
{type: "dog", a: 2}, | |
{type: "dog", b: 7}, | |
{type: "dog", c: 2}, | |
{type: "cat", d: 3}, | |
{type: "cat", e: 4}, | |
{type: "cat", f: 0}, | |
{type: "rabbit", g: 0}, | |
{type: "rabbit", h: 1} | |
] |
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
config.vm.define "ubu12" do |ubu| | |
ubu.vm.box = "ubu12_puppet" | |
ubu.vm.network :public_network, :bridge => 'eth0' | |
ubu.vm.network :private_network, :ip => '192.168.1.103' | |
ubu.vm.hostname = "ubu12-puppet-test" | |
ubu.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
ubu.vm.synced_folder "/home/kithokit/Dropbox/", "/root/Dropbox" | |
ubu.vm.synced_folder PUPPET_SOURCE, PUPPET_DEST | |
ubu.vm.synced_folder "templates" , '/tmp/vagrant-puppet/templates' | |
ubu.vm.provider :virtualbox do |vb| |
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
useradd kit | |
mkdir /home/kit | |
chown kit:kit /home/kit | |
mkdir /etc/abc | |
touch /etc/abc/12345 | |
touch /usr/kitbinary | |
mkdir /opt/kitoptbinary/ | |
touch /opt/kitoptbinary/okokok |
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
!#/usr/bin/env sh | |
mkdir -p ~/bin | |
#Download the CLI interface via wget: | |
wget -O ~/bin/dropbox.py "https://www.dropbox.com/download?dl=packages/dropbox.py" | |
#Set the permissions so you can execute the CLI interface: | |
chmod +x ~/bin/dropbox.py | |
~/bin/dropbox.py start -i | |
~/bin/dropbox.py start |
NewerOlder