Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
sudo mount -t cifs //192.168.1.10/pathTo_GIT /mnt/share -o username=myUsername,password=myPassword
@codecats
codecats / gist:a67ed3997e1e1d898ade
Last active November 16, 2022 10:01
SSH config for ubuntu (File path: "/etc/ssh/ssh_config")
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
@codecats
codecats / gist:d12305e613c61bd077bd
Created July 9, 2014 12:51
console create db mysql
CREATE DATABASE `mydb` CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL ON `mydb`.* TO `username`@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
@codecats
codecats / gist:3566f4e95956f909b429
Created August 9, 2014 18:22
pyenv basic commands
#switch version
pyenv global 2.7.5
#check version
python --version
2.7.5
#install version
pyenv install 2.7.5
@codecats
codecats / gist:b1b8ff9790be973d0e89
Created August 24, 2014 14:23
wget with triggers
wget -m -p -E -k -K --user-agent="Mozilla/5.0 (Windows NT 6.1; rv:2.0b7pre) Gecko/20100921 Firefox/4.0b7pre" -np "http://example.com"
@codecats
codecats / gist:08d2e1b4175dd5697457
Created December 4, 2014 20:38
django streaming file
def get(self, request, *args, **kwargs):
# def data():
# for i in xrange(10):
# csvwriter.writerow([i,"a","b","c"])
# data = read_and_flush()
# yield data
def stream_response_generator():
for x in range(1,11):
yield "%s\n" % x # Returns a chunk of the response to the browser
time.sleep(1)
  • create a new redis .conf file
$ cp /etc/redis.conf /etc/redis-xxx.conf
  • edit /etc/redis-xxx.conf, illustrated as below
...
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version

Install ElasticSearch and Java

1  wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2  sudo dpkg -i elasticsearch-1.0.1.deb
3  sudo update-rc.d elasticsearch defaults 95 10
4  sudo add-apt-repository ppa:webupd8team/java
5  sudo apt-get update
6  sudo apt-get install oracle-java7-installer
7  java -version
@codecats
codecats / Vagrant box
Created November 1, 2015 16:27
vagrant box
https://scotch.io/tutorials/how-to-create-a-vagrant-base-box-from-an-existing-one
vagrant box add crbox cr.box
clone code
vagrant init crbox
edit Vagrantfile (if not included- add 192.168.192.168)
create logs dir in ~/src
in apps dir copy local_settings_example > local_settings