Skip to content

Instantly share code, notes, and snippets.

View denji's full-sized avatar
🇺🇦

Denis Denisov denji

🇺🇦
View GitHub Profile
require 'formula'
class ClangCustom < Formula
homepage 'http://llvm.org/'
url 'http://llvm.org/releases/3.2/clang-3.2.src.tar.gz'
sha1 'b0515298c4088aa294edc08806bd671f8819f870'
head 'http://llvm.org/git/clang.git'
end

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@denji
denji / office.sh
Created April 17, 2014 22:55
completely remove MS Office from MAC OS X Lion $ sh office.sh
echo "Please exit out of all Microsoft Office products completely. Press any key to continue."
read ready
echo "Please enter your password."
sudo rm -R "/Applications/Microsoft Office 2011"
sudo rm -R "/Applications/Microsoft Messenger.app"
sudo rm ~/Library/Preferences/com.microsoft*
sudo rm -R ~/Library/Preferences/Microsoft/Office\ 2011
sudo rm /Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist
sudo rm /Library/PrivilegedHelperTools/com.microsoft.office.licensing.helper
sudo rm /Library/Preferences/com.microsoft.office.licensing.plist
@denji
denji / ocp.php
Created April 18, 2014 04:33 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
#!/usr/bin/perl
sub rtrim($) {
my $string = shift;
$string =~ s/\s+$//;
return $string;
}
@lines=(<>);
for (@lines) {
s/{if \$(.*?)}/{% if \1 %}/g;
s/{elseif \$(.*?)}/{% elif \1 %}/g;
@denji
denji / webstorm-dart.md
Last active August 29, 2015 14:00
WebStorm 8 + Brew + Dart

Install tap and Dart-Editor

brew tap kevmoo/kevmoo
brew install dart-editor --with-content-shell

Path for WebStorm - Dart SDK

echo (brew --prefix dart-editor)/dart-sdk/
@denji
denji / httpd-2.2.x-ecdh.md
Created May 1, 2014 06:05
(Apache 2.2) httpd-2.2.x-ecdh

... to meet the expectations of SSL Labs Server Test. But after hours of tuning your find out, that apache 2.2 isn't able to serve ECDHE-ciphers - even with openssl 1.0.1c. That's sad cause apache 2.2 is considered stable and ECDHE-ciphers are the only ones that work with internet explorer. So either no perfect forward secrecy for most of your visitors or upgrade to apache 2.4.

But behold, here is the solution: a patch against apache 2.2 to enable ECDHE in openssl 1.0.1c and up.

Just add

SSLHonorCipherOrder On
SSLProtocol ALL -SSLv2
SSLCipherSuite ECDH+AES256:EDH+AES256:-DHE-RSA-AES256-SHA:EDH+CAMELLIA256:DHE-RSA-AES256-SHA:ECDH+AES128:ECDH+RC4:ECDH+3DES:EDH+AES128:-DHE-RSA-AES128-SHA:EDH+CAMELLIA128:DHE-RSA-AES128-SHA:EDH+3DES:EDH+SEED:RSA+AES256:RSA+CAMELLIA256:RSA+AES128:RSA+CAMELLIA128:3DES:SEED:RC4-SHA:!aNULL:!eNULL:!EXP:!MD5 
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.