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
# get name of device | |
lsblk | |
file -s /dev/<device-name> | |
# replace xfs if different file system type | |
mkfs -t xfs /dev/<device-name> | |
mkdir /ebs1 | |
mount /dev/<device-name> /ebs1 |
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
# Run these commands after increasing the size of your volume in the AWS console to use the new space. | |
# list storage usage by volume | |
df -h | |
# let's say the filled up volume is called /dev/mapper/VolGroup00-rootVol | |
# list block devices to get the name of the filled up block device | |
lsblk | |
# let's say VolGroup00-rootVol is under nvme0n1p2 |
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
Edit value in properties file | |
$ propsFile="/opt/myapp/application.properties" | |
$ sed -i "s/\(server\.port\=\).*\$/\1New Text Here/" $propsFile |
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
################################## | |
# Based on https://medium.com/@dale.bingham_30375/setup-geoserver-for-a-local-gis-application-like-cesiumjs-14322f1178d5 | |
################################## | |
# Exit when any command fails | |
set -e | |
# Check if being run as root | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" |
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 | |
########################################################################################## | |
# Run on Ubuntu Server 18.04 | |
# Assumes *.tar.gz files are in the same dir as script | |
# - osm2pgsql.tar.gz from `git clone git://github.com/openstreetmap/osm2pgsql.git` | |
# - mod_tile.tar.gz from `git clone -b switch2osm git://github.com/SomeoneElseOSM/mod_tile.git` | |
# - openstreetmap-carto.tar.gz from `git clone git://github.com/gravitystorm/openstreetmap-carto.git` | |
# - map_data.tar.gz from `wget http://download.geofabrik.de/asia/azerbaijan-latest.osm.pbf` | |
# - shapefile_data.tar.gz from openstreetmap-carto/scripts/get-shapefiles.py |
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
For giving the group full access, use: | |
RUN umask 0002 |
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
@echo off | |
IF EXIST "C:\wildfly\standalone\deployments\myapp.jar*" ( | |
del "C:\wildfly\standalone\deployments\myapp.jar*" | |
) | |
IF EXIST "C:\myapp\target\myapp.jar" ( | |
copy C:\myapp\target\myapp.jar C:\wildfly\standalone\deployments\ | |
) | |
echo. & echo Deploy complete! | |
pause |
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
ROOT CA | |
-------------- | |
Generate the CA private key: | |
$ openssl genrsa -out ca.key 2048 | |
Create and self sign the root certificate: | |
$ openssl req -new -x509 -key ca.key -out ca.crt | |
Import root CA certificate into truststore: | |
$ keytool -import -file ca.crt -keystore ca.truststore -keypass <password> -storepass <password> |
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
Log into postgres via command line: | |
$ psql -h <host> -p <port> -U <username> -d <database> | |
Run script from command line: | |
$ psql -h <host> -p <port> -U <username> -d <database> -f <sql-script> |
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
# do NOT use same file for infile and outfile - will result in data loss | |
tr -d '\r' < infile > outfile |
NewerOlder