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
swift package generate-xcodeproj | |
> generated: ./MyProject.xcodeproj |
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
import PackageDescription | |
let package = Package( | |
name: "MyProject", | |
targets: [], | |
dependencies: [ | |
.Package(url: "https://github.com/SwiftyBeaver/SwiftyBeaver.git", | |
majorVersion: 1, minor: 0) | |
] | |
) |
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
// home route | |
app.get("/") { request in | |
// manual send test | |
NSLog("starting sending test on a serial queue ...") | |
var queue: DispatchQueue? | |
let uuid = NSUUID().uuidString | |
let queueLabel = "swiftybeaver-queue-" + uuid | |
queue = DispatchQueue(label: queueLabel, target: queue) | |
NSLog("using dispatch queue \(queueLabel)") |
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
import Foundation | |
import Vapor | |
import SwiftyBeaverVapor | |
import SwiftyBeaver | |
// set-up SwiftyBeaver logging destinations (console, file, cloud, ...) | |
let console = ConsoleDestination() // log to Xcode Console in color | |
let file = FileDestination() // log to file | |
file.logFileURL = URL(string: "file:///tmp/VaporLogs.log")! // set log file |
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
sudo su | |
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install htop -y | |
apt-get install unattended-upgrades -y && dpkg-reconfigure -plow unattended-upgrades | |
apt-get install ntp -y && ntpq -p && service ntp restart | |
reboot |
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
which swift && swift --version | |
curl -sL check.vapor.sh | bash |
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
curl -sL toolbox.vapor.sh | bash |
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
scp -r app.service YOUR_SERVER_IP:/tmp/ |
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
sudo systemctl status app | |
sudo systemctl start app | |
sudo systemctl stop app | |
sudo systemctl restart app | |
# run service automatically on reboot | |
sudo systemctl enable app | |
# more about systemctl | |
sudo systemctl --help |
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
sudo mv /tmp/app.service /lib/systemd/system | |
sudo chown root:root /lib/systemd/system/app.service | |
sudo systemctl daemon-reload | |
systemctl status app |