Skip to content

Instantly share code, notes, and snippets.

View giannis's full-sized avatar

Giannis Panagiotou giannis

View GitHub Profile
@giannis
giannis / gist:5256701
Last active December 15, 2015 11:59
This script starts mamp app without the need for a sudo password. In order to work you need to add a login entry on your keychain
#initial code from http://www.tech-otaku.com/local-server/starting-mamps-apache-mysql-servers-login/
tell application "Finder"
# Check if the Apache or MySQL servers are already running
set apacheRunning to my ProcessRunning("httpd")
set mysqlRunning to my ProcessRunning("mysqld")
# If neither the Apache nor MySQL servers are already running...
if (not apacheRunning and not mysqlRunning) then
# get the user name and password using the security Terminal command
set theUserName to do shell script ("security find-generic-password -l \"MAMP\" | grep \"acct\" | cut -c 19-99 | tr -d '\"'")
@giannis
giannis / rename_script.sh
Last active June 14, 2019 03:24
Renaming script for shell
#!/bin/bash
# this is a renaming script
# @arguments:
# -f filename the filename to add (optional)
# -p path the folder to path to run (optional)
# -r if set runs recuresively
#
# it renames the files inside the folder
# adds a sequential number filename (01).jpg etc
# if no filename specified there is the option to use