Category Archives: Sys Admin
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]' .
svn propset svn:executable on my-script
To mark a file in svn as executable:
svn propset svn:executable ON my-script
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!
How to escape @ characters in Subversion file names?
Found how to escape @ characters in Subversion managed file names?. The short answer is that you add an extra ‘@’ character at the end of the file name…
Let’s Encrypt & Nginx
An article about Let’s Encrypt & Nginx…
SQL Injection Cheat Sheet
Some notes on SQL injection…
Putting SELinux in Permissive mode on Fedora
See here for details. Basically edit /etc/selinux/config and change ‘enforcing’ to ‘permissive’.
How to downgrade a package in Debian using apt-get and apt-cache
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