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
# Define your SSH public keys here | |
PUBLIC_KEYS=( | |
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAR3QrP/+QYeSAeF5OIEh5H0FJPFbZBVijsgP90Ug9Cq" | |
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINs/phPOQePV+EM4SN8u9n7jrUw2Wg6eHvBholuExmJp Generated By Termius" | |
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMFvJRAIEEUl9LEE4VfriJEkJA13Vpz7l5fUlllcz8DF FS_DE_BIG/Ansible" | |
) | |
# Create the .ssh directory if it doesn't exist | |
mkdir -p ~/.ssh |
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
#!/bin/bash | |
# Define the path to the config file | |
CONFIG_FILE="/opt/nezha/agent/config.yml" | |
# Check if the config file exists | |
if [[ -f "$CONFIG_FILE" ]]; then | |
# Use sed to change disable_command_execute from false to true | |
sed -i 's/disable_command_execute: false/disable_command_execute: true/' "$CONFIG_FILE" | |
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
# Set variables in .bashrc file | |
# don't forget to change your path correctly! | |
export GOPATH=$HOME/golang | |
export GOROOT=/usr/local/opt/go/libexec | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin |
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 UIKit | |
extension UIViewController { | |
func hideKeyboardWhenTappedAround() { | |
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(UIViewController.dismissKeyboard)) | |
tap.cancelsTouchesInView = false | |
view.addGestureRecognizer(tap) | |
} | |
@objc func dismissKeyboard() { | |
view.endEditing(true) |
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
extension Date { | |
static func random() -> Date { | |
let randomTime = TimeInterval(Int32.random(in: 0...Int32.max)) | |
return Date(timeIntervalSince1970: randomTime) | |
} | |
} |
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
# | |
# systemd unit file for CentOS 7, Ubuntu 15.04 | |
# | |
# Customize this file based on your bundler location, app directory, etc. | |
# Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu). | |
# Run: | |
# - systemctl enable sidekiq | |
# - systemctl {start,stop,restart} sidekiq | |
# | |
# This file corresponds to a single Sidekiq process. Add multiple copies |
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
def quicksort(a) | |
return a unless a.count > 1 | |
pivot = a[0] | |
less = a.select {|num| num < pivot } | |
equal = a.select {|num| num == pivot } | |
greater = a.select {|num| num > pivot } | |
return quicksort(less) + equal + quicksort(greater) | |
end |
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
127.0.0.1 api.ad.xiaomi.com | |
127.0.0.1 sdkconfig.ad.xiaomi.com | |
127.0.0.1 ad.mi.com | |
127.0.0.1 ad.xiaomi.com | |
127.0.0.1 ad1.xiaomi.com | |
127.0.0.1 adv.sec.miui.com | |
127.0.0.1 test.ad.xiaomi.com | |
127.0.0.1 new.api.ad.xiaomi.com |
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
try | |
tell application "Finder" to quit | |
end try | |
delay 2 | |
tell application "Finder" to activate |