Check out Web Developer’s Toolbox…
Category Archives: Sys Admin
Adding ‘Attach to Icedove’ desktop/dolphin menu item on Debian Jessie
On Debian Jessie (testing) the default ‘Send as Email Attachment’ context menu item uses KMail, and only KMail, even if you’ve configured your desktop to use Icedove (Thunderbird) as your default mail client.
So you can remove the broken ‘Send as Email Attachment’ from Dolphin by opening Dolphin then:
Settings -> Configure Dolphin… -> Services -> uncheck ‘Send as Email Attachment’
Then to create a replacement feature that uses Icedove edit:
~/.kde/share/kd4/share/icedove_attachment.desktop
And enter:
[Desktop Entry] Type=Service Actions=attachToEmail Encoding=UTF-8 ServiceTypes=KonqPopupMenu/Plugin,all/allfiles ExcludeServiceTypes=application/x-iso,kdedevice/*,inode/directory [Desktop Action attachToEmail] Exec=icedove -compose "attachment='$(echo %F | sed 's/\\ \\//,\\/\\//g')'" Name=Attach to Icedove Name[it]=Invia E-mail con Icedove Name[es]=Enviar adjunto con Icedove Name[de]=Als Anhang mit Icedove verschicken Name[pt]=Anexar ao Icedove E-mail Name[pt_BR]=Enviar arquivo(s) como anexo(s) Name[fr]=Envoyer avec Icedove Name[nl]=Voeg toe als bijlage aan Icedove Name[pl]=Wyślij jako załącznik Icedove Name[ru]=Отправить с помощью Icedove Name[cz]=Odeslat jako přílohu Icedove Icon=/usr/lib/icedove/chrome/icons/default/default16.png
And make sure your .desktop file is executable:
$ chmod +x ~/.kde/share/kd4/share/icedove_attachment.desktop
Fetch as Google
Today I learned about Fetch as Google. Haven’t used it yet, though.
Removing Lenovo Superfish trojan
See here for details.
USA Time Zones in PHP
See here for a list of US time zones.
Eastern ........... America/New_York Central ........... America/Chicago Mountain .......... America/Denver Mountain no DST ... America/Phoenix Pacific ........... America/Los_Angeles Alaska ............ America/Anchorage Hawaii ............ America/Adak Hawaii no DST ..... Pacific/Honolulu
Ubuntu Releases (Standard and LTS)
Check out Ubuntu’s Release Plan Details…
Using Multiple SSL Certificates in Apache with One IP Address
Found Using Multiple SSL Certificates in Apache with One IP Address today. Basically:
<NameVirtualHost *:443> <VirtualHost *:443> ServerName www.yoursite.com DocumentRoot /var/www/site SSLEngine on SSLCertificateFile /path/to/www_yoursite_com.crt SSLCertificateKeyFile /path/to/www_yoursite_com.key SSLCertificateChainFile /path/to/DigiCertCA.crt </Virtual Host> <VirtualHost *:443> ServerName www.yoursite2.com DocumentRoot /var/www/site2 SSLEngine on SSLCertificateFile /path/to/www_yoursite2_com.crt SSLCertificateKeyFile /path/to/www_yoursite2_com.key SSLCertificateChainFile /path/to/DigiCertCA.crt </Virtual Host>
Running Apache2 with nice
See here.
Basically, edit /usr/sbin/apache2ctl and in start) add nice:
nice $HTTPD ${APACHE_ARGUMENTS} -k $ARGV
Xdebug trace != profile
So it just took me all night to figure out that in Xdebug ‘tracing’ is different to ‘profiling’.
It didn’t help that the xdebug.trace_output_name included an example format of ‘cachegrind.out.%s’. Why would you name a trace file cachegrind.out if only profile files are in cachegrind format!?
In my efforts to get profiling to work I found myself loading trace files into KCachegrind and getting the rather unhelpful message: “Could not open the file “/run/shm/xdebug/trace…xt”. Check it exists and you have enough permissions to read it.”
So the error message is about file permissions. I checked and checked and checked again but the file permissions were OK. The problem was I was loading a trace file, not a profile file.
So I gave up on KCachegrind and tried to get webgrind to work. Turns out loading a trace file (not a profile file) into webgrind doesn’t work either. I got the same problem reported by Sven about ‘parsers is undefined’. I fucked around trying to update the jquery.tablesorter plugin in webgrind, but the problem was due to the fact I was loading a tracing file, not a profiling file.
In the end I got it all figured out. Here’s my /etc/php5/mods-enabled/xdebug.ini file:
zend_extension=/usr/lib/php5/20131226/xdebug.so xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req ;xdebug.remote_host=127.0.0.1 xdebug.remote_host=10.1.1.203 ;xdebug.remote_port=9000 xdebug.remote_port=9999 ; http://www.xdebug.org/docs/all xdebug.profiler_enable=1 xdebug.profiler_output_dir=/run/shm/xdebug xdebug.profiler_output_name=cachegrind.out.%t.%R xdebug.auto_trace=1 xdebug.collect_assignments=1 xdebug.collect_includes=1 xdebug.collect_params=4 xdebug.collect_return=1 xdebug.collect_vars=0 xdebug.show_mem_delta=1 ;2 for HTML: xdebug.trace_format=0 xdebug.trace_options=1 xdebug.trace_output_dir=/run/shm/xdebug xdebug.trace_output_name=trace.%t.%R xdebug.var_display_max_children=-1 xdebug.var_display_max_data=-1 xdebug.var_display_max_depth=-1
The above config supports generation of tracing files and profiling files. I can now load my profiling files into KCachegrind and webgrind.
Everything is easy when you know how!
Change user’s password in Kerberos with kadmin
To change a user’s Kerberos password (on charity):
sudo kadmin -p root -w `cat /home/jj5/kadmin_root_pass` -q 'cpw eguser'
Where ‘eguser’ is the username of the account being changed.