Skip to content

Instantly share code, notes, and snippets.

if ((Get-Command "scoop" -ErrorAction SilentlyContinue) -eq $null)
{
#Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
scoop install git
scoop bucket add extras
}
scoop install thunderbird 7zip microsip foxit-pdf-reader googlechrome anydesk teamviewer zoom skype
@anothergituser
anothergituser / iptables_user
Last active January 20, 2019 12:27
iptables systemctl /etc/rc.d/init.d/iptables_user
#!/bin/bash
# chkconfig: - 50 50
# description: Initializes custom firewall
usage ()
{
echo $"Usage: $0 {start|stop|status|restart|condrestart}" 1>&2
}
start ()
#!/bin/bash
# https://wiki.archlinux.org/index.php/simple_stateful_firewall
iptables -F
iptables -X
iptables -N TCP
iptables -N UDP
iptables -P INPUT DROP
autodetach on
startup_message off
hardstatus alwayslastline
shelltitle 'bash'
hardstatus string '%{gk}[%{wk}%?%-Lw%?%{=b kR}(%{W}%n*%f %t%?(%u)%?%{=b kR})%{= w}%?%+Lw%?%? %{g}][%{d}%l%{g}][ %{= w}%Y/%m/%d %0C:%s%a%{g} ]%{W}'
bindkey -k k6 prev
bindkey -k k7 next
@anothergituser
anothergituser / backup.sh
Last active June 23, 2017 09:54
rsync website backup script
#!/bin/bash
# Website Backup Script
# http://webgnuru.com/linux/rsync_incremental.php
# Adapted to be run by anacron
# before running the script for the first time
# full_incremental should contain a dir like 2017-01-01
# empty or having a full backup
find . -iname "*.png" -exec file {} \; | awk '{print "convert source.png -resize",$5"x"$7,"out/"$1}' | sed 's/\(,\|:\|\.\/\)//g' > convert.sh
@anothergituser
anothergituser / gist:70a9572ec39eab5c8b1a
Created October 31, 2015 22:51
Watch laravel log in terminal using tail and grep
tail -f app/storage/logs/laravel.log | grep --line-buffered -v -P '(^#\d+|^Stack)'
@anothergituser
anothergituser / global.php
Created July 27, 2015 14:44
Laravel 4.2 clean logs
App::error(function(Exception $exception, $code)
{
if ($exception instanceof Symfony\Component\HttpKernel\Exception\NotFoundHttpException) {
Log::error([
'route' => Request::fullUrl(),
'user_id' => Auth::check() ? Auth::id() : "Anonymous",
'code' => $code,
'ip' => Request::ip(),
'headers' => Request::header('user-agent')
]);
@anothergituser
anothergituser / tmux.conf
Created October 13, 2014 19:18
tmux config
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
#Mouse works as expected
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
@anothergituser
anothergituser / ioc.php
Created June 24, 2012 23:04
PHP 5.3 Lightweight IOC container
<?php
/*
* Lightweight IOC container
*/
class IOC {
// if a hinted class name is matched here
// use the associated value as the new class