Skip to content

Instantly share code, notes, and snippets.

@brunogaspar
brunogaspar / README.md
Last active October 7, 2022 09:08
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@lucien144
lucien144 / backup.sh
Last active September 10, 2018 13:09
MySQL backup using s3cmd & automysqlbackup
#!/bin/bash
apt-get install automysqlbackup
apt-get install s3cmd
s3cmd --configure
s3cmd sync --recursive --delete-removed /var/lib/automysqlbackup/ s3://bucket/mysql/
s3cmd sync --exclude-from=/root/s3cmd.exclude --recursive --delete-removed /sites s3://bucket/sites/daily/`echo $(date +"%F")`/
find /var/lib/automysqlbackup/ -name *.sql.gz -mtime +7 -exec rm {} \;
@adamtester
adamtester / wkhtmltopdf.sh
Last active April 12, 2019 16:58
Install wkhtmltopdf on Ubuntu 14.04+
wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
sudo apt-get update
sudo apt-get install wkhtmltox
sudo apt-get -f install
sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
wkhtmltopdf -V
rm wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active April 18, 2025 16:10
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@janogarcia
janogarcia / email_coding_guidelines.md
Last active November 26, 2024 15:35
Email Coding Guidelines
@ohryan
ohryan / responsive-align.less
Last active April 30, 2019 17:27
Bootstrap 3 Responsive Text Align
.text-xs-left { text-align: left; }
.text-xs-right { text-align: right; }
.text-xs-center { text-align: center; }
.text-xs-justify { text-align: justify; }
@media (min-width: @screen-sm-min) {
.text-sm-left { text-align: left; }
.text-sm-right { text-align: right; }
.text-sm-center { text-align: center; }
.text-sm-justify { text-align: justify; }
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@k0nsl
k0nsl / disable-exim-cpanel-whm
Created November 11, 2013 21:01
A way to disable Exim (applies to WHM/cPanel too).
service exim stop
chkconfig exim off
touch /etc/eximdisable (or create an empty file in /etc with the filename 'eximdisable')
@denishvachhani
denishvachhani / function.php
Last active January 27, 2020 16:33
Remove Dashboard Widgets in Wordpress Backend
<?php
add_action('wp_dashboard_setup', 'remove_dashboard_widgets');
if( !function_exists('remove_dashboard_widgets') ) :
/**
*
*/
function remove_dashboard_widgets() {
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // Incoming Links
remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // Plugins
@rakeshtembhurne
rakeshtembhurne / render_view_as_variable.php
Created July 19, 2013 10:10
CakePHP: Render view in a variable inside controlller
<?php
$view = new View($this, false);
$view->set(compact('some', 'vars'));
$html = $view->render('view_name');