Skip to content

Instantly share code, notes, and snippets.

View opexxx's full-sized avatar

Alexander Knorr opexxx

View GitHub Profile
$servers = Get-Content C:\servers.txt
foreach($server in $servers)
{
if( Get-Service -ComputerName $server -Name "Sophos Message Router" -ErrorAction SilentlyContinue)
{
sc.exe \\$server stop "Sophos Message Router" | Out-Null
sleep 5
sc.exe \\$server start "Sophos Message Router" | Out-Null
# Clear console screen
clear
# Setup trap to catch exceptions
trap [Exception] {
Write-Error $("Trapped: " + $_.Exception.Message);
}
# Read computers from the text file
$computers = Get-Content 'C:\servers.txt';
@opexxx
opexxx / vhd2raw.cmd
Created April 30, 2015 12:45 — forked from mwchambers/gist:1319382
convert VHD file to RAW Image
qemu-img convert -O raw source.vhd output.raw
@opexxx
opexxx / domainTrust
Created May 4, 2015 14:30
DomainTrustDiagram.txt
digraph test {
rankdir = LR
"semikron.com" -> "skd.semikron.com"[label = "Trusts"]
"semikron.com" -> "ski.semikron.com"[label = "Trusts"]
"semikron.com" -> "ska.semikron.com"[label = "Trusts"]
"semikron.com" -> "skch.semikron.com"[label = "Trusts"]
"semikron.com" -> "skusa.semikron.com"[label = "Trusts"]
"semikron.com" -> "sksk.semikron.com"[label = "Trusts"]
"semikron.com" -> "skza.semikron.com"[label = "Trusts"]
@opexxx
opexxx / ssh_tunnel
Last active August 29, 2015 14:21 — forked from jarus/ssh_tunnel
#!/bin/sh
# Simple init script to dig a ssh tunnel
# Author: Christoph Heer <christoph.heer@googlemail.com>
SSH_ARGS="user@remote.host -p 22 -N -n -L 4950:localhost:4949"
PID_FILE="/var/run/remote_host_tunnel.pid"
case "$1" in
start)
if [ -f $PID_FILE ]; then
@opexxx
opexxx / ntfsutil.sh
Last active August 29, 2015 14:21 — forked from jsfaint/ntfsutil.sh
#!/bin/bash
mount_disk()
{
sudo umount $disk
mkdir ~/Desktop/$diskname
sudo mount_ntfs -o rw,auto,nodev,nobrowse,noowners,noatime $disk ~/Desktop/$diskname
echo "Mount $disk to ~/Desktop/$diskname"
open ~/Desktop/$diskname
}
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
@opexxx
opexxx / opt.md
Last active August 29, 2015 14:21 — forked from Alexnder/opt.md

Оптимизация png без потерь

apt-get install pngcrush

for file in *.png ; do pngcrush -reduce -brute -rem alla -rem gAMA -rem cHRM -rem iCCP -rem sRGB "$file" "${file%.png}-crushed.png" && mv "${file%.png}-crushed.png" "$file" ; done

Оптимизация jpg без потерь

apt-get install jpegoptim

jpegoptim *.jpg --strip-all

install

apt-get install squid3

configure

nano /etc/squid3/squid.conf

config file

http_access allow all
http_port 3128

cache_dir ufs /var/spool/squid3 1024 16 256