brew install openssl
openssl req -x509 -newkey rsa:4096 -keyout cert.key -out cert.crt -sha256 -days 3650 -nodes -subj "/C=XX/ST=YOUR_STATE/L=YOUR_LOCATION/O=YOUR_COMPANY/OU=YOUR_ORG/CN=YOUR_DOMAIN"
-- Find in progress transactions | |
SELECT * | |
FROM pg_stat_activity | |
WHERE state = 'idle in transaction' | |
AND pid <> pg_backend_pid() | |
AND query LIKE '%<table_name>%'; | |
-- Kill process | |
# Change macOS image name and USB drive name | |
# USB formatted as Mac OS Extended (Journaled) and choose GUID Partition Map as the Scheme. | |
sudo /Applications/Install\ macOS\ Sequoia.app/Contents/Resources/createinstallmedia --volume /Volumes/Sequoia | |
# Press and hold power button for boot menu (Apple Silicon) |
set -a; source .env; set +a |
git config --local user.name "Sumit Sahoo" | |
git config --local user.email "[email protected]" |
"terminal.integrated.fontSize": 13, | |
"terminal.integrated.fontFamily": "'MesloLGS NF','JetBrains Mono', Menlo, Monaco, 'Courier New', monospace", |
# Remove delay | |
defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0 && killall Dock | |
# Faster animation | |
# defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0.65 && killall Dock | |
# Revert back | |
# defaults delete com.apple.dock autohide && defaults delete com.apple.dock autohide-delay && defaults delete com.apple.dock autohide-time-modifier && killall Dock |
# Deletes the Android Studio application | |
# Note that this may be different depending on what you named the application as, or whether you downloaded the preview version | |
rm -Rf /Applications/Android\ Studio.app | |
# Delete All Android Studio related preferences | |
# The asterisk here should target all folders/files beginning with the string before it | |
rm -Rf ~/Library/Preferences/AndroidStudio* | |
rm -Rf ~/Library/Preferences/Google/AndroidStudio* | |
# Deletes the Android Studio's plist file | |
rm -Rf ~/Library/Preferences/com.google.android.* | |
# Deletes the Android Emulator's plist file |
# First create a user group and add users who are going to use shared brew | |
# User group : brew-usergroup | |
echo $(brew --prefix) | |
echo $(groups $(whoami)) | |
sudo dseditgroup -o edit -a $(whoami) -t user brew-usergroup | |
sudo chgrp -R brew-usergroup $(brew --prefix)/* | |
sudo chmod -R g+rwX $(brew --prefix)/* | |
ls -lah $(brew --prefix) |
private static boolean isJson(String Json) { | |
try { | |
new JSONObject(Json); | |
} catch (JSONException ex) { | |
try { | |
new JSONArray(Json); | |
} catch (JSONException ex1) { | |
return false; | |
} | |
} |