Skip to content

Instantly share code, notes, and snippets.

View arielallon's full-sized avatar
🙊

Ariel Allon arielallon

🙊
View GitHub Profile
@arielallon
arielallon / gist:7809038
Created December 5, 2013 16:53
Set available resolution on external monitor - ubuntu
xrandr --newmode "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync
xrandr --addmode VGA1 "1280x720_60.00"
@arielallon
arielallon / recusrive-sed-on-mac.sh
Last active December 30, 2015 09:28
sed (find and replace) recursively on Mac
LANG=C; LC_CTYPE=C; find . -type f -print0 | xargs -0 sed -i '' 's/find/replace/g'
@arielallon
arielallon / add-to-redmine-via-curl.sh
Last active December 30, 2015 09:28
Create issue in redmine with curl
curl https://tracker.gorillagroup.com/projects/paypalus-stories/issues --data "authenticity_token=NWVbmXqmzX5QwrlmVZYKh8dsCmeyYBpsh1uQvLkaLrY%3D&issue%5Btracker_id%5D=2&issue%5Bsubject%5D=Browse%20Product%20Listing&issue%5Bdescription%5D=n&issue%5Bstatus_id%5D=1&issue%5Bpriority_id%5D=4&issue%5Bstart_date%5D=2013-06-28&commit=Create" --cookie "__utma=240483989.1196912062.1346860753.1365776739.1370875271.16;__utmc=240483989;__utmz=240483989.1359496404.11.2.utmcsr=gorillapolymedia.com|utmccn=(referral)|utmcmd=referral|utmcct=/;__CT_Data=gpv=6&apv_7906_www14=6; WRUID=0;__unam=7596e76-13b1927425c-74d02766-35;wp4280=XVBTDDDDDDTTUHWIDU-TTUXIVDnhkpssHnkhNi_Jht;_redmine_session=BAh7DSIVZmlsZXNfaW5kZXhfc29ydCINZmlsZW5hbWU6DXBlcl9wYWdlaTc6CnF1ZXJ5ewk6EWNvbHVtbl9uYW1lczA6DGZpbHRlcnN7BiIOc3RhdHVzX2lkewc6DW9wZXJhdG9yIgZvOgt2YWx1ZXNbBiIAOg9wcm9qZWN0X2lkaQK8AToNZ3JvdXBfYnkwOg9zZXNzaW9uX2lkIiU1Njk0ZTk2NzQ3OThiNTI2ZjU1ZWY2NGQyMDQ0ZDE5YToMdXNlcl9pZGlWOhBfY3NyZl90b2tlbiIxTldWYm1YcW16WDVRd3JsbVZaWUtoOGRzQ21leVlCcHNoMXVRdkxrYUxyW
@arielallon
arielallon / db-replace-Magento-base_url.sql
Last active December 30, 2015 09:28
Find & Replace base_url in Magento
-- Warning: be careful what you're searching for and that it only exists exactly where you expect it to.
UPDATE core_config_data set value = replace(value, 'old', 'new');
@arielallon
arielallon / ssh-tunnel.sh
Last active December 30, 2015 09:28
ssh tunnel
ssh -f -N -L 8080:localhost:80 username@remotehost
# <local port>:localhost:<remote port>
# remove by killing the process. use `ps aux | grep ssh` to find it
@arielallon
arielallon / mysqldump.sh
Last active December 30, 2015 09:28
mysqldump
# replace USERNAME, DBNAME, HOSTNAME.OR.IP, and PROJECTNAME
mysqldump --single-transaction --opt --events --routines -u USERNAME -p DBNAME -h HOSTNAME.OR.IP | sed -E 's/DEFINER=`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' | bzip2 > PROJECTNAME_`date "+%Y%m%d-%H%M%S"`.sql.bz2
@arielallon
arielallon / 9 cUrl tips
Created December 5, 2013 16:57
9 cUrl tips
Working with HTTP from the command-line is a valuable skill for HTTP architects and API designers to have. The cURL library and curl command give you the ability to design a Request, put it on the pipe, and explore the Response. The downside to the power of curl is ho https://httpkit.com/resources/HTTP-from-the-Command-Line/ w much breadth its options cover. Running curl --help spits out 150 different flags and options. This article demonstrates nine basic, real-world applications of curl .
In this tutorial we’ll use the httpkit echo service as our end point. The echo server’s Response is a JSON representation of the HTTP request it receives.
Make a Request
Let’s start with the simplest curl command possible.
@arielallon
arielallon / tmpfs-mount.sh
Last active December 30, 2015 09:28
tmpfs mount
sudo mount tmpfs /home/aallon/workspace/paypal/trunk/var/full_page_cache -t tmpfs -o size=64m
@arielallon
arielallon / sample-apache-host.conf
Last active December 30, 2015 09:29
Create a Self Signed SSL Certificate
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName local.gor-paypalhere.ca
SSLEngine on
SSLOptions +StrictRequire
SSLProtocol -all +TLSv1 +SSLv3
SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM
@arielallon
arielallon / ppt-notes-to-txt.vba
Last active December 30, 2015 09:29
Export PPT notes to TXT
Option Explicit
Sub ExportNotesText()
Dim oSlides As Slides
Dim oSl As Slide
Dim oSh As Shape
Dim strNotesText As String
Dim strFileName As String
Dim intFileNum As Integer