Skip to content

Instantly share code, notes, and snippets.

View zsim0n's full-sized avatar

Zoltan Simon zsim0n

View GitHub Profile
@zsim0n
zsim0n / .gitignore
Last active August 29, 2015 14:04
Atlassian OnDemand Backup script
*.cookie
*.zip
@zsim0n
zsim0n / drush-commands
Last active August 29, 2015 14:04
Usefull shell commands
#!/bin/bash -eux
# Get an admin login link
drush uli
# Set the password for any user
drush upwd admin --password="newpassword"
@zsim0n
zsim0n / gist:8d3d39048cef73701373
Created December 23, 2014 06:48
Insert External CSS TYPO3 CMS (frontend)
page.includeCSS {
font-awesome = //maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css
font-awesome.external = 1
}
@zsim0n
zsim0n / gist:bfc282d0bc66bda6e45b
Created February 5, 2015 08:32
Count number of files in sub-folders
find . -maxdepth 1 -type d | while read -r dir; do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done
@zsim0n
zsim0n / gist:208945df4ab2ebf5da91
Created February 27, 2015 22:08
how-to-chmod-755-all-directories-but-no-file-recursively
find /path/to/base/dir -type d -exec chmod 755 {} +
To recursively give files read privileges:
find /path/to/base/dir -type f -exec chmod 644 {} +
Or, if there are many objects to process:
chmod 755 $(find /path/to/base/dir -type d)
chmod 644 $(find /path/to/base/dir -type f)
Or, to reduce chmod spawning:
@zsim0n
zsim0n / gist:f7c0e2d1a069f9822a22
Last active August 29, 2015 14:20
merge github upstream(fork) repo
git remote add upstream https://github.com/<maintainer>/<repo>.git
git fetch upstream
git checkout master
git merge upstream/master
@zsim0n
zsim0n / koding-provisioning.sh
Last active September 18, 2015 07:26
koding.com provisioning
# locale
sudo locale-gen da_DK.UTF-8
sudo apt-get -y update
sudo apt-get -y install php5-intl
sudo apt-get -y install php5-curl
kpm install composer
kpm install kdbin
kpm install grunt
kpm install pip
@zsim0n
zsim0n / wp-install.sh
Last active July 8, 2017 03:06
create-wordpress-site-with-wp-cli
mkdir wordpress
cd wordpress
wp core download
wp core config --dbname=<database name> --dbuser=<database username> --dbpass=<database password>
wp db create
wp core install --url=<url> --title=<title> --admin_user=<admin_user> --admin_password=<admin_pw> --admin_email=<admin_email>
wp uninstall akismet
wp uninstall hello
@zsim0n
zsim0n / free-up-space-ubuntu.sh
Created August 18, 2015 08:54
Free up space on Ubuntu
# https://wiki.ubuntu.com/ReducingDiskFootprint#Documentation
sudo bash
# Purge documentations
# http://askubuntu.com/questions/129566/remove-documentation-to-save-hard-drive-space
find /usr/share/doc -depth -type f ! -name copyright|xargs rm || true
find /usr/share/doc -empty|xargs rmdir || true
rm -rf /usr/share/man/* /usr/share/groff/* /usr/share/info/*
rm -rf /usr/share/lintian/* /usr/share/linda/* /var/cache/man/*
@zsim0n
zsim0n / aws API Gateway unicode workaround base64-util.js
Last active March 24, 2022 15:16
AWS API Gateway UTF-8 (unicode) workaround
// inspiration
// http://timnew.me/blog/2013/01/30/pitfall-in-node-crypto-and-base64-encoding/
// https://github.com/kevva/base64-regex
Base64Util = {
encode64: function(text) {
return new Buffer(text, 'utf8').toString('base64');
},
decode64: function(base64) {
return new Buffer(base64, 'base64').toString('utf8');
},