Add ssh key to host in one line
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
import java.io.BufferedOutputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.sql.Connection; | |
import java.sql.PreparedStatement; |
import javax.mail.Message; | |
import javax.mail.MessagingException; | |
import javax.mail.Session; | |
import javax.mail.internet.InternetAddress; | |
import javax.mail.internet.MimeBodyPart; | |
import javax.mail.internet.MimeMessage; | |
import javax.mail.internet.MimeMultipart; | |
import java.awt.*; | |
import java.io.File; | |
import java.io.FileOutputStream; |
version: "3" | |
services: | |
sonarqube: | |
image: sonarqube | |
expose: | |
- 9000 | |
ports: | |
- "127.0.0.1:9000:9000" | |
networks: |
import javax.ws.rs.core.Response; | |
import java.util.Optional; | |
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
import static javax.ws.rs.core.MediaType.TEXT_PLAIN_TYPE; | |
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR; | |
import static javax.ws.rs.core.Response.Status.OK; |
// uses Apache commons CSV, IO and Lang | |
import org.apache.commons.csv.CSVFormat; | |
import org.apache.commons.csv.CSVParser; | |
import org.apache.commons.csv.CSVPrinter; | |
import org.apache.commons.io.FileUtils; | |
import org.apache.commons.io.IOUtils; | |
import java.io.*; | |
import java.util.ArrayList; | |
import java.util.List; |
/* | |
* Assuming a schema similar to the Cassandra wiki quick start (http://wiki.apache.org/cassandra/GettingStarted): | |
* CREATE TABLE mykeyspace.users ( | |
* user_id int PRIMARY KEY, | |
* fname text, | |
* lname text, | |
* user_id int | |
* ) | |
* | |
* RETURNs THIS: |
# | |
# cqlsh_intro.cql | |
# | |
# Copyright (C) 2017 Jeff Carpenter | |
# Execute the commands in this file for a short guided tour of the CQL Shell (cqlsh) | |
# | |
# For more description, see Cassandra, The Definitive Guide 2nd Ed., Chapter 3: Installing | |
# http://shop.oreilly.com/product/0636920043041.do | |
# |
#ssh use key | |
Step 1: Generate a key on local | |
>ssh-keygen -t rsa -b 3096 | |
Step 2: logon to remote server | |
>cd ~ | |
>mkdir .ssh | |
Step 3: copy public key to remote server | |
>scp ~/.ssh/id_rsa.pub username@remote_ip:/home/username/.ssh/uploaded_key.pub |
Add ssh key to host in one line
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
:: chocolatey install | |
powershell -c "Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" | |
:: scoop install | |
powershell -c "Set-ExecutionPolicy RemoteSigned -scope CurrentUser; iex (new-object net.webclient).downloadstring('https://get.scoop.sh')" | |
choco feature enable -n allowGlobalConfirmation | |
:: essentials | |
choco install openjdk |