# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
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
public static void main(String[] args) throws Exception { | |
Properties props = System.getProperties(); | |
props.setProperty("mail.store.protocol", "imaps"); | |
Session session = Session.getDefaultInstance(props, null); | |
Store store = session.getStore("imaps"); | |
store.connect("imap.gmail.com", "[email protected]", | |
"qwerty!@#$%"); | |
Folder folder = store.getFolder("INBOX"); |
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
import com.google.inject.AbstractModule; | |
import com.google.inject.Guice; | |
import com.google.inject.Inject; | |
import com.google.inject.name.Named; | |
import com.google.inject.name.Names; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.util.Properties; |
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
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" | |
PROFILE="$HOME/.profile" | |
echo "Downloading git-completion..." | |
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then | |
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1 | |
fi |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
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
curl -O http://ftp.gnu.org/gnu/wget/wget-1.17.tar.gz | |
tar -xzf wget-1.17.tar.gz | |
cd wget-1.17 | |
ln -s /usr/local/opt/openssl /usr/local/ssl | |
./configure --with-ssl=openssl | |
./configure --with-ssl=openssl --with-libssl-prefix=/usr/local/ssl | |
make | |
sudo make install | |
wget --help | |
cd .. && rm -rf wget* |
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
//More info: <https://thenewobjective.com/blog/2013/01/dynamic-programming-for-great-justice/> | |
// Imperative: O(n) time, O(1) space | |
function fib(n){ | |
if(n < 2) | |
return n; | |
var f0 = 0, f1 = 1, f; | |
for(var i = 1; i < n; i++){ |
For each record read from the Kinesis Stream, a StepFunction state machine will be executed asynchronously.
- region: the AWS region where your StepFunction state machine is defined.
- stateMachineArn: the ARN of the StepFunction state machine you want to 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
fs = require('fs') | |
path = require('path') | |
request = require('request') | |
class twitter_update_with_media | |
constructor: (@auth_settings) -> | |
@api_url = 'https://api.twitter.com/1.1/statuses/update_with_media.json' | |
post: (status, file_path, callback) -> | |
r = request.post(@api_url, oauth:@auth_settings, callback) |
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
// change group currency task registration | |
export let changeGroupCurrency = functions | |
.database | |
.ref('/serverTasks/currencyChange/{taskId}') | |
.onWrite(event => changeGroupCurrency(event)); | |
// function which changes group's currency and updates exchange rates of all expenses | |
async function changeGroupCurrency(event: Event<DeltaSnapshot>) | |
{ | |
// prevent triggering this function after writing response code |