Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
v-thomp4 / gist:9374c6aa1639a71b8a7e
Created September 19, 2014 07:08
Broadcom B43 WiFi not working in Ubuntu 14.04 LTS
For Broadcom BCM4311,
sudo apt-get purge bcmwl-kernel-source broadcom-sta-common broadcom-sta-source
sudo apt-get install b43-fwcutter firmware-b43-installer
@v-thomp4
v-thomp4 / gist:41ec76b3982c615267e5
Created September 22, 2014 04:08
The special characters Regex
Characters Meaning
$ End of a line
^ Start of a line
[] Character class
? The preceding item is optional and matched at most once
* Zero or more of the preceding item
+ One or more of the preceding item
{} Match some number of the preceding item
| Alternation (true if either of the regexes it separates match)
. Any one character
@v-thomp4
v-thomp4 / gist:a1a52482b29209919774
Created September 24, 2014 02:15
htpasswd nginx
sudo apt-get install apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd exampleuser
server {
location / {
auth_basic "Restricted"; #For Basic Auth
auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth
}
}
@v-thomp4
v-thomp4 / gist:9f579be11b21efa96dc5
Created September 25, 2014 03:18
Error while pull from git - insufficient permission for adding an object to repository database .git/objects
sudo chown -R $USER:$USER "$(git rev-parse --show-toplevel)/.git"
@v-thomp4
v-thomp4 / gist:a9cc2bf4ca680c416c87
Created September 25, 2014 04:07
Joomla - Troubleshooting extension installation errors
http://www.rsjoomla.com/support/view-article/1012-troubleshooting-extension-installation-errors.html
@v-thomp4
v-thomp4 / gist:ffed5c2be5945982a9d9
Last active August 29, 2015 14:07
monitor folder and send mail
#!/bin/bash
inotifywait -m /path/to/folder -e modify,create -e moved_to |
while read path action file; do
echo "The file '$file' appeared in directory '$path' via '$action'" | mailx -s 'Monitor File' your_email.com
done
@v-thomp4
v-thomp4 / gist:c04297239f4e8238e722
Created October 8, 2014 02:55
fix git permission
cd .git/
sudo chmod -R g+ws *
sudo chgrp -R www-data *
git config core.sharedRepository true
sync data
gsutil rsync -d -r /path/to/folder gs://bucket
set public-read
gsutil acl -R set public-read gs://bucket
setmeta
gsutil setmeta -R -h "Cache-Control:public, max-age=604800" gs://bucket
@v-thomp4
v-thomp4 / gist:fb7d7a4dc9dc4c396a72
Last active March 21, 2016 21:14
Dockerizing an SSH Daemon Service

Dockerfile:

# sshd
#
# VERSION               0.0.2

FROM ubuntu:14.04
MAINTAINER Sven Dowideit <[email protected]>

RUN apt-get update &amp;&amp; apt-get install -y openssh-server
@v-thomp4
v-thomp4 / maintenance.html
Last active November 1, 2015 10:53 — forked from pitch-gist/gist:2999707
maintenance page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>