For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
| package demo.plain; | |
| import org.keycloak.OAuth2Constants; | |
| import org.keycloak.admin.client.CreatedResponseUtil; | |
| import org.keycloak.admin.client.Keycloak; | |
| import org.keycloak.admin.client.KeycloakBuilder; | |
| import org.keycloak.admin.client.resource.RealmResource; | |
| import org.keycloak.admin.client.resource.UserResource; | |
| import org.keycloak.admin.client.resource.UsersResource; | |
| import org.keycloak.representations.idm.ClientRepresentation; |
| module.exports = (string) => { | |
| return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase(); | |
| }; |
| <excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> | |
| <excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> | |
| <excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/_build/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> | |
| <excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/deps/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> |
| select | |
| pc_games.title, | |
| to_char(pc_games.release_date, 'YYYY-MM-DD') as release_date | |
| array_to_string(array_agg(avid_fans.firstname || ' ' || avid_fans.surname), ', ', null) as fans | |
| from | |
| schema_A.pc_games as pc_games | |
| inner join schema_A.avid_fans as avid_fans on (pc_games.id = avid_fans.fk_pc_game_id) | |
| where | |
| pc_games.release_date > '2004-12-31' | |
| group by |
| package main | |
| import ( | |
| "image" | |
| "image/png" | |
| "log" | |
| "os" | |
| "time" | |
| "golang.org/x/image/draw" |
| // 1. npm init | |
| // 2. npm install --save webpack webpack-dev-server babel-loader babel-preset-es2015 | |
| // 3. mkdir dist && touch index.html | |
| // 4. Include `<script src="/bundle.js"></script>` inside index.html | |
| // 5. mkdir src && touch src/index.js | |
| // 6. Add some code to index.js (e.g. `console.log('Hello, World!')) | |
| // 7. npm start | |
| // 8. Browse to http://localhost:8080/dist/ | |
| const webpack = require('webpack') |
A collection of Natural Language Processing (NLP) Ruby libraries, tools and software. Suggestions and contributions are welcome.
| #!/bin/bash | |
| case "$OSTYPE" in | |
| darwin*) PLATFORM="OSX" ;; | |
| linux*) PLATFORM="LINUX" ;; | |
| bsd*) PLATFORM="BSD" ;; | |
| *) PLATFORM="UNKNOWN" ;; | |
| esac | |
| replace() { |
On Tue Oct 27, 2015, history.state.gov began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:
2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files)
2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...
An article at http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.
su to run ulimit on the nginx account, use ps aux | grep nginx to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits (where pid is the process id retrieved from ps). (Note: sudo may be necessary on your system for the cat command here, depending on your system.)fs.file-max = 70000 to /etc/sysctl.conf