Posts

systemctl: Show running services

systemctl list-units --type service --state running

Google Maps API: Allow local files from your desktop computer

Assuming that you have already created the key... Go to https://console.developers.google.com/apis/credentials Make sure you have the right project selected from the dropdown at the top Click the API Key Under "Application restrictions" select "HTTP referrers (websites)" Under "Website restrictions" click "ADD AN ITEM" Put __file_url__//*  into the box that appears Click "SAVE"

IPTables: Clear all rules

When you need to clear all rules and set the default police to ACCEPT. iptables-save | sed "/-/d;/^#/d;s/DROP/ACCEPT/" | iptables-restore This is not permanent. The default rules will be reloaded if IPTables, your firewall or the server is restarted.

MySQL/Percona: Show the order of configuration files

Show which files the database server uses and the order they are read. Get the server binary location # which mysqld /usr/sbin/mysqld Get the configuration file locations and order # /usr/sbin/mysqld --verbose --help | grep -A 1 "Default options" Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf

Excel: Strikethrough Shortcut

Ctrl + 5 Easier than having to go into the Font -> Extended menu every time.

Google Chrome: Manage Flash Sites

Image
The HTML5 client for VMware is missing some functionality so I need to run the Flash client in Google Chrome. I normally run the Canary or Dev channels of Chrome and the ability to add or block a sites ability to run Flash seems to have disappeared from Settings -> Advanced -> Content Settings -> Flash. It is still there in the Stable channel. My default Flash setting in all is "Ask First", but nothing happens in  Canary and Dev As per the instructions on: https://support.google.com/chrome/answer/6258784?co=GENIE.Platform%3DDesktop&hl=en The site needs Flash to work If a website isn’t working, you might need to change your settings to allow Flash. To the left of the web address, click Lock   or Info  . At the bottom, click Site Settings. In the new tab, to the right of "Flash," click Allow. Go back to the site and reload the page.

Linux: Permanent CIFS/SMB mount

I needed to permanently mount a directory on a Windows server that had spaces in the path. I also wanted to use a credentials file so that the remote server username and password would not be in the world readable fstab file. The following was cobbled together from: Mount samba shares with utf8 encoding using cifs and: Mount password protected network folders Create a credentials file (as root) containing the username and password and restrict it's ability to be read by other users (/etc/fstab is world readable). vi /root/.smbcredentials username=someusername password=somepassword Save and exit the file. Change the file permissions to only be readable by root. chmod 600 /root/.smbcredentials Update the fstab file Add the following line to /etc/fstab (spaces are replaced with \040  or the mount will fail) // ip address / c$/Program\040Files/Microsoft\040SQL\040Server/ /var/backups/Server cifs credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm 0 0 Exit ...