Skip to content

Instantly share code, notes, and snippets.

Avatar
👌
Progress is progress. No matter how small.

Szymon Bluma bluemanos

👌
Progress is progress. No matter how small.
View GitHub Profile
@bluemanos
bluemanos / .bash_aliases
Created Dec 18, 2018
Docker bash aliases
View .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 / composer
Last active Sep 16, 2015
Composer with default --profile option
View composer
#!/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 Aug 17, 2015
Clear printer queue on Windows 8
View clear printer queue.bat
:: 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 Aug 17, 2015
Laravel IDE helper command
View DevCommand.php
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class DevCommand extends Command
{
/**
* The console command name.
@bluemanos
bluemanos / gist:e699c886a10f38182769
Last active Nov 16, 2015
Download page with CSS/JS/IMG folder structure
View gist:e699c886a10f38182769
# 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' {} +
View ssh_config
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
ServerAliveInterval 60
TCPKeepAlive yes
View apache2 - local.host.conf
<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 Aug 29, 2015
Convert tabs to spaces in PHP/HTML/CSS/TXT files
View expand
#!/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 Dec 16, 2014
Connect meld to git diff usage
View diff_meld
#!/usr/bin/python
import sys
import os
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))
@bluemanos
bluemanos / chmods
Created Dec 16, 2014
Recursive change chmods for directories and files
View chmods
#!/bin/sh
path=${1:-.}
echo $path
echo $(date)
find "$path" -type d -exec chmod 755 {} \;
find "$path" -type f -exec chmod 644 {} \;
You can’t perform that action at this time.