Showing posts with label tech. Show all posts
Showing posts with label tech. Show all posts

Monday, July 30, 2012

Handy trick for using django runserver/testmaker on remote server

Thanks Bart for showing me how to have a local version of django running on my VPS.

On the VPS start django as required, eg

python manage.py runserver
python manage.py testmaker -a web

Now do this from a command line where 1.2.3.4 is your vps ip:

ssh root@1.2.3.4 -L 5984:localhost:8000 -N

enter the password and it should not come back with anything.

Now go to this URL and your website should start

http://localhost:5984/

Wednesday, July 25, 2012

D3 Nest function - converting csv data to nested data for treemaps etc.

Just finished 8 examples of how to use the javascript visualisation library D3 nest function - notes to self really, but shared in case they are useful for others.

 http://bl.ocks.org/3176159 to see the code
 http://bl.ocks.org/d/3176159/ to see all the examples run.

Thursday, July 12, 2012

Simple D3 examples to try

I learn by looking at examples and then trying to modify them to do what I want. I've started creating little gists to record how use different features of d3. In case they help others, here is a start. They can all be run in bl.ocks

Processing CSV strings and files and grouping with nest:

  • https://gist.github.com/3053667 - processing csv string 
  • https://gist.github.com/3053705 - processing csv file 
  • https://gist.github.com/3096857 - nesting/grouping to two levels



Drawing Axes:

  • https://gist.github.com/3053419 - simplest possible
  • https://gist.github.com/3059392 - date axis
  • https://gist.github.com/3061203 - prettified, angled date labels and uses extent
  • https://gist.github.com/3098488 - rescale an axis using a transition


Wednesday, October 17, 2007

Favorite Unix Commands

I am by no means a unix expert and don't use it often enough to have these commands at my fingertips, so I collecting them in one place:

Restart Server:
shutdown -r now

What's running:
ps aux

What using up disk space
du -k | sort -rn | head -20

Check for latest package:
rpm -qa | grep "mysql"

To replace all instances of oranges with bananas in the file mytext.txt

sed -e 's/oranges/bananas/g' mytext.txt

This will display the file with changes. I havn't found a way of making the changes in situ, but to write the output to a new file:

sed -e 's/oranges/bananas/g' mytext.txt > newfile.txt

20 most recently updated files:
find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort -r | head -20

What's using memory
top

Value of environment variables set
export


List of all files recursively, containing text
grep -lir "no todo" *