Found a cool old program: pr_comment.c…
Category Archives: Programming
Get just the filename with grep (note: sed not required!)
To just print the filename that matches a grep expression, without the matched text, use the -l (lowercase L) command-line arg. So e.g.:
grep -Rl 'jsphp.co[^m]' .
Installing latest version of Scala on Debian
So this is basically a combination of this and this:
sudo apt-get purge scala sudo apt-get autoremove cd ~/desktop/scala wget http://downloads.lightbend.com/scala/2.11.8/scala-2.11.8.tgz tar xzf scala-2.11.8.tgz sudo mv scala-2.11.8 /usr/share/scala sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac sudo ln -s /usr/share/scala/bin/fsc /usr/bin/fsc sudo ln -s /usr/share/scala/bin/sbaz /usr/bin/sbaz sudo ln -s /usr/share/scala/bin/sbaz-setup /usr/bin/sbaz-setup sudo ln -s /usr/share/scala/bin/scaladoc /usr/bin/scaladoc sudo ln -s /usr/share/scala/bin/scalap /usr/bin/scalap
Everything is easy when you know how!
Getting Started with Scala
Today I read Getting Started with Scala.
SQL Injection Cheat Sheet
Some notes on SQL injection…
PHP values
How to downgrade a package in Debian using apt-get and apt-cache
Reply
See here. Basically:
dpkg --list apt-cache showpkg packagename apt-get install packagename=version echo "packagename hold" | sudo dpkg --set-selections
Administering PostgreSQL
So I found this article which said:
$ sudo -u postgres psql
postgres=> alter user postgres password 'apassword'; postgres=> create user your-user createdb createuser password 'passwd'; postgres=> create database your-db-name owner your-user; postgres=> \q
Note: to enable password logins for the ‘postgres’ admin account, edit: /etc/postgresql/9.4/main/pg_hba.conf and after this line:
local all postgres peer
Add this line:
local all postgres md5
How do I list all databases and tables using psql?
So I found this which said:
- \list or \l
- list all databases
- \dt
- list all tables in the current database
Converting a C++ std::string to char*
So it turns out there is a std::string->c_str function. Note: I’m pretty sure this char[] will be deleted when the std::string is deleted…
