Skip to content

Instantly share code, notes, and snippets.

View antonbabenko's full-sized avatar
🇺🇦

Anton Babenko antonbabenko

🇺🇦
View GitHub Profile
@antonbabenko
antonbabenko / upload_public.sh
Last active August 29, 2015 14:04
s3-mp-upload example
#!/bin/sh
time ./s3-mp-upload.py -f -np 10 -s 20 -t 300 --insecure archive.zip s3://builds.antonbabenko.com/archive.zip
s3cmd setacl --acl-public s3://builds.antonbabenko.com/archive.zip
@antonbabenko
antonbabenko / fontawesome_3_to_4_migration.sh
Created May 13, 2014 11:15
FontAwesome 3.2.1 to 4 migration (using sed)
#!/bin/sh
# This is universal part for all FontAwesome projects (I suppose :)
find src -type f -iname '*.css' -or -iname '*.js' -or -iname '*.twig' -exec sed -i -r \
-e "s,(['\"\t ])icon-fixed-width(['\"\t ]),\1fa-fw\2,g" \
-e "s,(['\"\t ])icon-large(['\"\t ]),\1fa-lg\2,g" \
-e "s,(['\"\t ])icons-ul(['\"\t ]),\1fa-ul\2,g" \
-e "s,(['\"\t ])icon-li(['\"\t ]),\1fa-li\2,g" \
-e "s,(['\"\t ])icon-spin(['\"\t ]),\1fa-spin\2,g" \
@antonbabenko
antonbabenko / deploy.rb
Created May 9, 2014 15:53
`symfony:verify_console` task for Capifony to verify if application is bootable
# `symfony:verify_console` task verify if application is bootable (config&parameters.yml contains all required keys).
# It outputs error text if app/console can't boot.
after "symfony:composer:install", "symfony:verify_console"
#################################################################
namespace :symfony do
task :verify_console do
capifony_pretty_print "--> Run app/console to verify if parameters.yml has all required keys and application is runnable"
@antonbabenko
antonbabenko / create_pr.sh
Created April 1, 2014 10:50
How to create PR from command line when diff is very large
curl -u username:password \
--header 'X-GitHub-OTP: your_code_here' \
--request POST \
--data '{"title":"Merge staging into master", "head":"staging", "base":"master"}' \
https://api.github.com/repos/zoozoo-ab/zoozoo/pulls
@antonbabenko
antonbabenko / ubuntu_apptus
Created March 28, 2014 18:29
Run Apptus on Ubuntu (using Vagrant)
# Run Apptus on Ubuntu (using Vagrant)
# vagrant up
# vagrant ssh
sudo apt-get install openjdk-7-jdk
/esales/install_server.sh
######
@antonbabenko
antonbabenko / myip.sh
Created February 28, 2014 08:37
Extract your external IP from command line
dig +short myip.opendns.com @resolver1.opendns.com
@antonbabenko
antonbabenko / cors.inc
Last active November 18, 2023 20:22
(nginx AND varnish) + CORS (working example)
more_set_headers "Access-Control-Allow-Origin: $http_origin";
more_set_headers "Access-Control-Allow-Credentials: true";
# OPTIONS indicates a CORS pre-flight request
if ($request_method = 'OPTIONS') {
more_set_headers "Access-Control-Max-Age: 1728000";
more_set_headers "Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS";
more_set_headers "Access-Control-Allow-Headers: Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since";
more_set_headers "Content-Length: 0";
@antonbabenko
antonbabenko / circle.yml
Created September 4, 2013 17:24
Disabling all builds in circle.yml
# test
machine:
environment:
CIRCLECI: false
CI: false
branches:
ignore:
- /.*/
@antonbabenko
antonbabenko / vm.html
Created July 26, 2013 08:15
VM in iframe
<!DOCTYPE html>
<html>
<head>
<title>VM iframe</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<iframe src="http://www.victoriamilan.com/" scrolling="no" style="width: 1000px; height: 800px; border: 0px; overflow: auto;"></iframe>
@antonbabenko
antonbabenko / gist:3156298
Created July 21, 2012 16:15
Useful shell commands (network, Varnish, etc)
# Show which process is on this port:
netstat -tulpn | grep :80
# List urls which miss:
varnishtop -i txurl
# Activity by IP:
varnishlog -b -m TxHeader:88.88.88.88
# Purge URL from curl: