init: Alfred preferences

This commit is contained in:
2026-03-26 09:22:38 +08:00
commit 3cad72b72c
13215 changed files with 108280 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
{
"alfredsnippet" : {
"snippet" : "echo '#!\/bin\/bash\n\n# Check if a username was provided as an argument\nif [ $# -ne 1 ]; then\n echo \"Error: Please provide a username as an argument.\"\n exit 1\nfi\n\n# Get the username from the argument\nusername=\"$1\"\n\n# Prompt for the user'\\''s password\nread -s -p \"Enter password for $username: \" password\necho\n\n# Add the user and set the password\nsudo adduser --home \/home\/$username --gecos \"\" --disabled-password $username\necho \"$username:$password\" | sudo chpasswd\n\n# Add the user to the sudo group\nsudo usermod -aG sudo $username\n\n# Configure the sudoers file to allow the user to use sudo without a password\necho \"$username ALL=(ALL:ALL) ALL\" | sudo tee -a \/etc\/sudoers\necho \"$username ALL=NOPASSWD: ALL\" | sudo tee -a \/etc\/sudoers' > create_user_and_configure_sudo.sh\n\nchmod +x create_user_and_configure_sudo.sh\n",
"uid" : "34C8CA5B-0065-4DA5-97C1-EA88A872D5A1",
"name" : "create_user_and_configure_sudo.sh",
"keyword" : "script"
}
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>snippetkeywordprefix</key>
<string></string>
<key>snippetkeywordsuffix</key>
<string></string>
</dict>
</plist>

View File

@@ -0,0 +1,8 @@
{
"alfredsnippet" : {
"snippet" : "echo '#!\/bin\/bash\n\nSHELL=\/bin\/sh\nPATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\nTZ=\"Asia\/Taipei\"\nexport PATH\nexport LANG=en_US.UTF-8\nexport LANGUAGE=en_US:en\n\n# Check if curl is installed\nif ! command -v curl &> \/dev\/null; then\n echo \"Error: curl is not installed. Please install curl and try again.\"\n exit 1\nfi\n\n# Check if jq is installed\nif ! command -v jq &> \/dev\/null; then\n echo \"Error: jq is not installed. Please install jq and try again.\"\n exit 1\nfi\n\ncurl -s http:\/\/ip-api.com\/json | jq' > ip_info.sh\n\nchmod +x ip_info.sh\n",
"uid" : "99EA04E6-6D57-4748-A63F-A401EE9EC954",
"name" : "ip_info.sh",
"keyword" : "script"
}
}