Skip to content

Instantly share code, notes, and snippets.

View bms8197's full-sized avatar

Bogdan Stoica bms8197

View GitHub Profile
@iacchus
iacchus / socket.io-1-0-apache-2.4-ssl.conf
Last active September 21, 2022 18:45
Set reverse proxy websockets in Apache 2.4 using socket.io 1.0. Needs mod_rewrite module, this version uses SSL. As seen here https://serverfault.com/questions/616370/configuring-apache-2-4-mod-proxy-wstunnel-for-socket-io-1-0
<VirtualHost *:80>
ServerName forum.example.com
Redirect permanent / https://forum.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName forum.example.com
@catalint
catalint / createvhosts.php
Created April 25, 2014 07:46
Putting nginx in front of the Apache server that comes with Cpanel can be tricky. Bellow is a script that reads the cpanel config files of the accounts and builds nginx server's (similar to Apache vhost) from them. It can also be added to do this automatically when new accounts and domains are registered on the server. The script's coding style …
<?php
$conf='/etc/nginx/vhosts/vhost.conf';
$confFile=fopen($conf,'w');
exec("find /var/cpanel/userdata/* -type f -not -name '*cache*' -not -name '*db' -not -name 'main' -not -name 'vhost*'",$ary);
foreach ($ary as $f){
$fis=file_get_contents($f);
preg_match("@\ndocumentroot..(.*)@",$fis,$ROOT);
$ROOT=$ROOT[1];
preg_match("@\nip..(.*)@",$fis,$IP);
$IP=$IP[1];
@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect