Chrome Breaks Custom Search Engines – version 37.0.2062.94

Google Chrome version 37.0.2062.94 breaks custom search engines. Yep, that’s right. If you had added custom search engines ( and custom shortcuts ) in your Chrome preferences they will not work in incognito mode with this version of Chrome, at least on Mac OS X. This has been an issue even with this version of chrome was in BETA mode, but now it is also affecting the “stable” version.

It may be worth it to downgrade to an older version of Chrome. If you do this you may get the message about “Your profile is from a newer version of Google Chrome” but that can easily be remedied. ( just search for the message )

Posted in Mac | Leave a comment

Install mitmproxy from source on Ubuntu

If you want to live on the dangerous side, you can install mitmproxy from its master branch. If you encounter any bugs, please do us the favor and report them on the Github issue tracker briefly.

Install from source using PIP

pip uninstall mitmproxy netlib
pip install git+https://github.com/mitmproxy/netlib.git@master
pip install git+https://github.com/mitmproxy/mitmproxy.git@master

Install from source on Ubuntu

Installing mitmproxy master from sources on stock Ubuntu – first uninstall using:

pip uninstall mitmproxy netlib

Now install the required tools:

$ sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev python-pip libxml2-dev libxslt-dev git

Now install with sudo:

$ sudo pip install git+https://github.com/mitmproxy/netlib.git@master
$ sudo pip install git+https://github.com/mitmproxy/mitmproxy.git@master

Now start up a python console and paste in these two commands – this is a workaround for issue 32 :

$ sudo python  #
>>> from netlib import certffi
>>> exit()

Source: github gist

Posted in Linux | Tagged , , | Leave a comment

Install syslinux 3.86 on Ubuntu

Get the syslinux 3.86 download from here, maybe the syslinux-3.86.tar.gz file

To build syslinux-3.86 on Ubuntu, Debian, and similar:

apt-get install build-essential nasm
cd /tmp
wget "https://www.kernel.org/pub/linux/utils/boot/syslinux/3.xx/syslinux-3.86.tar.gz"
tar -xf syslinux-3.86.tar.gz
cd /tmp/syslinux-3.86
make

you will most likely get some errors about building for windows, but when this process finishes you will have the 3.86 version of syslinux working.

Execute the main program by running:

/tmp/syslinux-3.86/linux/syslinux

You can also do a make install but that may conflict with other versions of syslinux you have installed ( if you have already tried apt-get install syslinux, for example)

Another note, you can run apt-get install syslinux-legacy to get a version of syslinux that is around 3.63 to 3.82:

Check all of the versions by doing something like this:

$ which syslinux
/usr/bin/syslinux
$ strings /usr/bin/syslinux | grep SYSLINUX
SYSLINUX
SYSLINUX 4.05
SYSLINUX 4.05 20140113
$ which syslinux-legacy
/usr/bin/syslinux-legacy
$ strings /usr/bin/syslinux-legacy | grep SYSLINUX
SYSLINUX
SYSLINUX 3.63 Debian-2012-04-16
$ strings /tmp/syslinux-3.86/linux/syslinux | grep SYSLINUX
SYSLINUX
SYSLINUX 3.86 0x53e5a115
Posted in Server Admin | Leave a comment

ThinkCentre M83 (10AK) Linux Network Driver

The IBM ThinkCentre M83 ( types 10AG, 10AK, 10AL, and 10BE) have the Intel I217 / L217LM Clarkville according to their spec sheet

Their driver download page does not have a linux network driver.

However, the Intel Download Center provides a driver that should work for these machines.

Posted in Uncategorized | Leave a comment

Fail2ban: Block CIDR IP Address Ranges (aka wildcard)

It has been requested to have the ability in fail2ban to block whole IP address ranges.

Yaroslav Halchenko replied, saying

we are working on the features which would occur in some 0.9.x release which would make it configurable out-of-the-box, but meanwhile you can just easily create an augmented action file where you would have customized iptables call with /XX to ban whatever big subnet you like

Well, at the time of this writing the current version is Fail2Ban v0.8.6 – and it seems to not have CIDR capabilities out of the box. However, you can still have fail2ban block an IP address by using a command like this:

fail2ban-client -vvv set apache banip 1.2.3.0/24

Your fail2ban log file ( maybe /var/log/fail2ban.log ) should have information about the rule you just added. Also, the -vvv flag tells the command to be verbose.

For the rule to take effect, you may need to wait until one of the other files fail2ban is monitoring has a change. So check out your /etc/fail2ban/jail.local file, see what is enabled, and then run touch /path/to/file on a logfile you are watching with fail2ban

Posted in Server Admin | Leave a comment

How to use http_get_request_headers with PECL_HTTP version 2

If you’re using the version 2 pecl_http (possibly version 2.0.6?) on your webserver, perhaps Ubuntu or CentOS, with PHP5, maybe 5.3, 5.4, or 5.5, you may have noticed that after getting it all installed and adding this to your php.ini file:

extension=raphf.so
extension=propro.so
extension=http.so

But then when you try and use the function get_request_headers() you end up getting:

PHP Fatal error: Call to undefined function http_get_request_headers()

Well, when this extension switched to pecl/http v2 it changed a lot of things, and global functions was one of them. It now uses namespaces, and so instead of using http_get_request_headers() you’ll need to use something like this:

$headers = \http\Env::getRequestHeader();
print_r($headers);

The check out the docs for more details on how to use the new function, basically you’ll see

getRequestHeader: Retrieve one or all headers of the current HTTP request.

Parameters:

Optional string $header_name

The key of a header to retrieve.

Returns:

  • NULL, if $header_name was not found
  • string, the compound header when $header_name was found
  • array of all headers if $header_name was not specified
Posted in Web Development | Tagged , | Leave a comment

How to install pecl pecl_http with homebrew php54 / php55

You may be tempted to try and run pecl install pecl_http if you’re using homebrew on Mac OS X in order to be able to access functions like http_get_request_headers – but there’s a better way. Instead, try using the command brew install php54-http or brew install php55-http ( depending on if you are using php 5.4 or php 5.5 with homebrew )

You can get more info about pecl_http with homebrew by using brew info php54-http or brew info php55-http ( again depending on your PHP version ).

If you have already tried pecl install pecl_http you may want to run pecl uninstall pecl_http before running the other commands.

If you have previously used something like brew install php54-http and now it doesn’t seem to be loading, check your configuration file in /usr/local/etc/php/5.4/conf.d or try doing:

brew remove php54-http

And then running:

brew install php54-http
Posted in Tech Tips | Tagged , | Leave a comment

zshell: rsync hostname completion with zsh

If you use ssh a lot with zsh and have a lot of entries in your hostsfile (/etc/hosts) you might find it convenient to disable completion from these hosts by using:

zstyle ':completion:*' hosts off

However, this may give you adverse affects, and your hostnames may stop auto-completing with rsync – in order to fix this try also adding this in to your .zshrc

zstyle -s ':completion:*:hosts' hosts _ssh_config
[[ -r ~/.ssh/config ]] && _ssh_config+=($(cat ~/.ssh/config | sed -ne 's/Host[=\t ]//p'))
zstyle ':completion:*:hosts' hosts $_ssh_config

If you also use oh-my-zsh and are still having trouble, trying adding those lines after this line:

source $ZSH/oh-my-zsh.sh
Posted in Tech Tips | Tagged , | Leave a comment

Hide “You can search from here with Google” in Chromium

If you’re running chrome in kiosk mode Google Chrome, or Chromium, or even if you are not using kiosk mode, you may have encountered the nuisance popup bubble telling you:

You can search from here with Google

According to a bug ticket you can create a master_preferences file “in the same directory as the chrome binary” and add this information to it:

{
    "distribution" : {
        "suppress_first_run_bubble": true
    }
}

That did not work for me, however, I used a command line switch ( a.k.a. a “flag” ) to successfully disable this popup balloon from showing.

Just use:

--no-first-run

When you are launching the Chrome / Chromium player.

That would look something like this on Linux:

./chrome --no-first-run

Or like this on Windows:

C:\path_to_chrome\chrome.exe --no-first-run
Posted in Linux | Tagged , | Leave a comment

strange error flushing buffer – solved

When trying to use some LAME libraries like the WAV2SWF from swftools I started gettin this error:

strange error flushing buffer

The file was still generated but it did not work.

Here’s what I did to fix:

Installed the latest version of swftools

This was done on Ubuntu but you can probably do almost the same thing on Mac OS X. I tried using homebrew but was not able to get a new enough version of the software.

Make sure you have zlib

sudo apt-get install zlib1g-dev

Or

brew install zlib

Next check the downloads page and get the latest version of the software, something like:

cd /tmp
wget "http://swftools.org/swftools-2013-04-09-1007.tar.gz"
cd swftools-2013-04-09-1007
./configure
make

You can then install this if you want, but to test I just continued without installing:

cd src
./wav2swf ~/input.wav

this gave me another error:

Error: no mp3 soundstream support compiled in.

So to get around needing support for that you can just specify some additional parameter so it doesn’t have to detect them:

./wav2swf -d -s 44100 -o ~/test.swf ~/input.wav

And voila! it worked!

Additional parameters are:

Usage: wav2swf [-o filename] file.wav
-h , --help                    Print short help message and exit
-V , --version                 Print version info and exit
-o , --output <filename>       Explicitly specify output file. (Otherwise, output will go to output.swf)
-r , --framerate <fps>         Set file framerate to <fps> frames per second.
-s , --samplerate <sps>        Set samplerate to <sps> frames per second (default: 11025).
-d , --definesound             Generate a DefineSound tag instead of streaming sound.
-l , --loop n                  (Only used with -d)
-C , --cgi                     For use as CGI- prepend http header, write to stdout.
-S , --stop                    Stop the movie at frame 0
-E , --end                     Stop the movie at the end frame
-b , --bitrate <bps>           Set mp3 bitrate to <bps> (default: 32)
-v , --verbose                 Be more verbose
Posted in Linux, Mac | Tagged , , | Leave a comment