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
//query to create an index in background. won't stop current reads/writes on the collection | |
db.collection.createIndex( { 'key1': 1 }, { background: true } ) | |
//query to create a compount index in background. won't stop current reads/writes on the collection | |
db.collection.createIndex( { 'key1': 1, 'key2': 1 }, { background: true } ) | |
//to check the progress of indexing operation | |
db.currentOp(true).inprog.forEach(function(op){ if(op.msg!==undefined) print(op.msg) }) | |
//to kill the indexing operation, just in case. |
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 | |
sudo apt-get -y install ruby | |
sudo apt-get -y install wget | |
# this location varies for every region. replace aws-codedeploy-us-west-1 with name given here https://docs.aws.amazon.com/codedeploy/latest/userguide/resource-kit.html#resource-kit-bucket-names | |
wget -c https://aws-codedeploy-us-west-1.s3.amazonaws.com/latest/install | |
chmod +x ./install | |
sudo ./install auto |
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
SSH Login as openvpnas user | |
$ ssh openvpnas@<open-vpn-server-ip> | |
$ cd /usr/local/openvpn_as/scripts/ # Go to OpenVPN AS Scripts directory | |
$ sudo ./sacli --user USERNAME GoogleAuthRegen # Replace USERNAME with username to get a new Google Authenticator Secret | |
Source: https://forums.openvpn.net/viewtopic.php?t=15366 |
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
# maximum capability of system | |
user@ubuntu:~$ cat /proc/sys/fs/file-max | |
708444 | |
# available limit | |
user@ubuntu:~$ ulimit -n | |
1024 | |
# To increase the available limit to say 200000 | |
user@ubuntu:~$ sudo vim /etc/sysctl.conf |
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
upstream railsapp { | |
server 0.0.0.0:5000 weight=10 max_fails=5 fail_timeout=30s; | |
} | |
server { | |
listen 80; | |
server_name admin.com; | |
location / { | |
proxy_pass http://railsapp/; |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
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
class Order | |
attr_accessor :amount | |
def amount=(given_amount) | |
#write your logic here | |
end | |
end | |
order = Order.new |
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
public void addAComment(Comment c) throws Exception{ | |
openConnection(); | |
Statement st = connection.createStatement(); | |
String query = "insert into comments (comment,personid,personname,issueid,commenton,companyid) " + | |
"values('"+c.getComment()+"',"+c.getPersonid()+",'"+c.getPersonname()+"',"+c.getIssueid()+",'"+c.getCommenton()+"',"+c.getCompanyid()+")"; | |
st.execute(query); | |
System.out.println("====Comment added"); | |
closeConnection(); | |
} | |
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
UI- and App Frameworks Evangelist - Jake Behrens, [email protected], twitter: @Behrens | |
- What's new in Cocoa | |
- Accessibility in iOS | |
- Building User Interfaces for iOS 7 | |
- Getting Started with UIKit Dynamics | |
- What's new in Cocoa Touch | |
- What's New With Multitasking | |
- Best Practices for Cocoa Animation | |
- Improving Power Efficiency with App Nap | |
- Introducing Text Kit |
NewerOlder