Skip to content

Instantly share code, notes, and snippets.

Sydney-o9 Sydney-o9

Block or report user

Report or block Sydney-o9

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install-selenium-bonus-2.sh
# Start Selenium server
start_selenium
# stop Selenium server
stop_selenium
# Status for Selenium server
status_selenium
status_selenium -v
View install-selenium-bonus.sh
# @Author Jobinhood
BV_GREEN_TICK='\e[0;32m [✔] \e[0m';
BV_RED_CROSS='\e[0;91m [✗] \e[0m';
BV_YELLOW_DOT='\e[0;33m [.] \e[0m';
BV_YELLOW_DOTS='\e[0;33m ... \e[0m';
# Helper to run sudo commands for us by asking
# sudo password if needed
sudo_needed() {
View install-selenium-10.sh
# Start Selenium
sudo launchctl load /Library/LaunchDaemons/org.seleniumhq.selenium.plist
# Stop Selenium
sudo launchctl unload /Library/LaunchDaemons/org.seleniumhq.selenium.plist
# Is it working?
ps -ef | grep selenium | grep java | grep chromedriver | grep -v grep | grep -c selenium
# Will show 0 if selenium is not running, and 1 otherwise
View install-selenium-9.xml
<?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>Label</key>
<string>org.seleniumhq.selenium</string>
<key>UserName</key>
<string>_selenium</string>
<key>ProgramArguments</key>
<array>
View install-selenium-9.sh
# Create plist file in /Library/LaunchDaemons
vi /Library/LaunchDaemons/org.seleniumhq.selenium.plist
View install-selenium-8.sh
# Start Selenium
java -Dwebdriver.chrome.driver=/usr/local/selenium/drivers/chromedriver -jar /usr/local/selenium/bin/selenium-server-standalone-3.8.1.jar
# Make sure it works
ps -ef | grep selenium | grep -v grep
View install-selenium-7.sh
# Change group ownership to _selenium
sudo chown -R _selenium:_selenium /usr/local/selenium
View install-selenium-6.txt
$ sudo dscl
Entering interactive mode… (type “help” for commands)
 > cd /Local/Default
 > ls Groups gid
 
...
_selenium 703
_sshd 75
_www 70
...
View install-selenium-5.sh
# Create group _selenium with gid 703
sudo dscl . -create /Groups/_selenium
sudo dscl . -create /Groups/_selenium PrimaryGroupID 703
# Make sure it now exists
dscacheutil -q group | grep gid | awk ‘{print $2}’ | sort -n | tail -n 1
# Create the deamon user _selenium
sudo dscl . -create /Users/_selenium UniqueID 703
sudo dscl . -create /Users/_selenium PrimaryGroupID 703
View install-selenium-4.sh
# Make sure user _selenium does not already exist
sudo dscl . -read /Users/_selenium
You can’t perform that action at this time.