Skip to content

Instantly share code, notes, and snippets.

// IPSUM image generator [http://ipsumimage.appspot.com]
$ipsum-img-api: 'http://ipsumimage.appspot.com' !default;
@mixin ipsum-img($width, $height, $label: false) {
@if $label {
background-image: url($ipsum-img-api + '/' + $width + 'x' + $height + '?l=' + $label);
} @else {
background-image: url($ipsum-img-api + '/' + $width + 'x' + $height);
}
background-position: center center;
@Vitre
Vitre / .htaccess
Created November 2, 2014 12:02
Laravel .htaccess for WEDOS
# htaccess rules for subdomains and aliases
# to create new subdomain, create a folder www/subdom/(subdomain name)
# to create web for alias, create a folder www/domains/(whole domain name)
# htaccess pravidla pro subdomeny a samostatne weby aliasu
# pro vytvoreni subdomeny vytvorte adresar www/subdom/(nazev subdomeny)
# pro vytvoreni webu pro alias vytvorte adresar www/domains/(cely domenovy nazev)
# dalsi info a priklady: http://kb.wedos.com/r/32/webhosting-htaccess.html
#Options -MultiViews
@Vitre
Vitre / axure-web-fonts
Last active September 1, 2015 18:31
FontAwesome CDN
https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css
https://fonts.googleapis.com/icon?family=Material+Icons
@Vitre
Vitre / httpd chmod
Last active November 22, 2015 17:23
Apache source permission fix
sudo find . -type f -exec chmod 644 {} \; && sudo find . -type d -exec chmod 755 {} \;
sudo chmod -R 777 ./
chmod g=,o=rx /home/*
# chmod revert
git diff --numstat | awk '{if ($1 == "0" && $2 == "0") print $3}' | xargs git checkout HEAD
git diff --summary | grep --color 'mode change 100755 => 100644' | cut -d' ' -f7- | xargs -d'\n' chmod +x
git diff --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs -d'\n' chmod -x
@Vitre
Vitre / SSH-KEYGEN linux
Last active August 29, 2015 14:19
SSH-KEYGEN linux
ssh-keygen -t rsa -C "your_email@example.com"
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
clip < ~/.ssh/id_rsa.pub
@Vitre
Vitre / Ubuntu-Helpers.sh
Last active December 12, 2015 15:42
Ubuntu helpers
# Root clear
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
# Unity Lens DISABLE
gsettings set com.canonical.Unity.Lenses disabled-scopes "['more_suggestions-amazon.scope', 'more_suggestions-u1ms.scope', 'more_suggestions-populartracks.scope', 'music-musicstore.scope', 'more_suggestions-ebay.scope', 'more_suggestions-ubuntushop.scope', 'more_suggestions-skimlinks.scope']"
# Spotify FIX
@Vitre
Vitre / gist:e41f9c80f77102736d3674ec18a4b3bb
Last active November 19, 2018 15:28
Apache Windows Service
"c:\Host\opt\Apache\2.4\bin\httpd" -k uninstall -n "Apache 2.4 - PHP X"
"c:\Host\opt\Apache\2.4\bin\httpd" -k install -n "Apache 2.4 - PHP 7.2.12" -f "C:\Host\etc\apache\httpd-2.4-php-7.2.12.conf"
@Vitre
Vitre / apt-upgrade.sh
Last active February 21, 2018 15:34
apt upgrade
echo '#upgrade' && sudo apt-get autoremove -y && sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get autoremove -y && read -p "Reboot (y/n)?" CONT && [ "$CONT" = "y" ] && sudo reboot
@Vitre
Vitre / bcrypt-ruby-fix.sh
Last active November 21, 2017 14:53
bcrypt-ruby fix
bundle install && gem uninstall bcrypt-ruby --force && gem uninstall bcrypt --force && gem install bcrypt --platform=ruby
@Vitre
Vitre / mattermost-upgrade.sh
Created October 27, 2017 08:51
Mattermost upgrade
ln -s /home/mattermost/config/ /home/mattermost/mattermost/ && ln -s /home/mattermost/data/ /home/mattermost/mattermost/ && ln -s /ho me/mattermost/logs/ /home/mattermost/mattermost/
sudo chown -R mattermost:mattermost ./mattermost