Skip to content

Instantly share code, notes, and snippets.

View bluemanos's full-sized avatar

Szymon Bluma bluemanos

  • Dąbrowa Górnicza, PL
  • 01:48 (UTC +02:00)
  • X @bluemanos
View GitHub Profile
@bluemanos
bluemanos / .bash_aliases
Created December 18, 2018 19:32
Docker bash aliases
#docker
alias docker-rm='docker rm $(docker ps -aq)'
alias docker-rmi='docker rmi $(docker images -q)'
alias docker-stop='docker stop $(docker ps -a -q)'
alias docker-ssh='docker-compose exec php bash'
alias docker-start='docker-compose up -d'
alias docker-ss='docker-stop && docker-start && docker-ssh'
@bluemanos
bluemanos / gist:e699c886a10f38182769
Last active November 16, 2015 18:39
Download page with CSS/JS/IMG folder structure
# recursive download all page and linked subpages
wget -p -N -r -np http://url-to-download.com/page/
# mass rename files
rename -v 's/\.php/\.html/' *.php
# batch replace text in files (recursive)
find . -type f -exec sed -i 's/.php/.html/g' {} +
@bluemanos
bluemanos / composer
Last active September 16, 2015 10:36
Composer with default --profile option
#!/bin/sh
/path/to/your/composer $* --profile
# and place the composer gist file in location like /usr/local/bin/composer
@bluemanos
bluemanos / clear printer queue.bat
Created August 17, 2015 21:16
Clear printer queue on Windows 8
:: save as file with *.bat extension
:: run as administrator
Net Stop Spooler
del %systemroot%\System32\spool\printers\* /Q
Net Start Spooler
@bluemanos
bluemanos / DevCommand.php
Created August 17, 2015 19:21
Laravel IDE helper command
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class DevCommand extends Command
{
/**
* The console command name.
@bluemanos
bluemanos / ssh_config
Created June 10, 2015 08:44
ssh config
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
ServerAliveInterval 60
TCPKeepAlive yes
@bluemanos
bluemanos / apache2 - local.host.conf
Last active August 29, 2015 14:18
Ubuntu Dev Wildcard
<VirtualHost *:80>
ServerAdmin szymon.bluma@polcode.net
DocumentRoot /home/szymon/webs/wildcard
ServerName wwww.local.host
ServerAlias *.*.local.host
VirtualDocumentRoot /home/szymon/webs/wildcard/%2/source/public/
<Directory "/home/szymon/webs/wildcard">
Options All
AllowOverride All
Require all granted
@bluemanos
bluemanos / expand
Last active August 29, 2015 14:11
Convert tabs to spaces in PHP/HTML/CSS/TXT files
#!/bin/sh
# script to convert tabs to spaces in PHP files
# usage: ./expand /path/to/project/directory
echo $(date)
path=${1:-.}
for f in $(find "$path" -type f -name \*.php -o -name \*.html -o -name \*.css -o -name \*.txt -o -name \*.js)
do
@bluemanos
bluemanos / diff_meld
Created December 16, 2014 10:58
Connect meld to git diff usage
#!/usr/bin/python
import sys
import os
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))
@bluemanos
bluemanos / chmods
Created December 16, 2014 10:56
Recursive change chmods for directories and files
#!/bin/sh
path=${1:-.}
echo $path
echo $(date)
find "$path" -type d -exec chmod 755 {} \;
find "$path" -type f -exec chmod 644 {} \;