Find all symbolic links on a linux OS:
|
1 |
find / -type l -exec ls -l {} \; |
Or if you want to output it to a file:
|
1 |
find / -type l -exec ls -l {} \; > /home/admin/symbolic_link_list.txt |
Find all symbolic links on a linux OS:
|
1 |
find / -type l -exec ls -l {} \; |
Or if you want to output it to a file:
|
1 |
find / -type l -exec ls -l {} \; > /home/admin/symbolic_link_list.txt |
Granting permissions in MySQL, localhost and external hosts must be separately run, the % sign means any external host and will not account for local connections:
|
1 2 3 |
GRANT ALL PRIVILEGES ON *.* TO root@"localhost" IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'password'; FLUSH PRIVILEGES; |
But say you wanted to then remove remote access, but leave local access, easy (with this being the actual part I learned. I wanted to write both granting and denying down.):
|
1 2 |
DELETE FROM mysql.user WHERE User = 'root' AND Host = '%'; FLUSH PRIVILEGES; |
To correct the issue, on the iPhone, go to iMessages
To check if you have the problem yourself:
Go to settings > Messages > Send and Receive
Under “You can be reached by iMessage at”, if your phone number is not ticked, you have this problem.
To fix (this worked for me):
Go to Settings > Messages
Turn off iMessage
Go to Settings > Cellular
Turn off Cellular Data
Reboot phone
Turn Cellular Data and iMessage back on
Go to Settings > Messages > Send and Receive
Under “Start new conversations from”, tick your phone number
If you want to fail back to SMS messaging when iMessage is unavailable, make sure to enable Settings > Messages > Send as SMS. This was disabled by default on my fresh iOS7, and can cause text messages to be mysteriously delayed.
For more detail on the problem, see http://simonhackett.com/2013/11/06/ios7-imessage-mobile-number-linking/
Process Monitor, by SysInternals under Microsoft, shows real-time file system, Registry and process/thread activity. To do this it registers itself with the Event Tracing for Windows to receive activity reports from both the file system and the windows registry.
It can be found here: Windows Sysinternals Process Monitor.
Some basics of what to expect to see, here is a resized window, giving all of the default information I want to go over:

Capture (Ctrl+E): Enables/Disables capturing activity.
Autoscroll (Ctrl+E): Enables/Disables scrolling of display as activity is shown. I find it best to disable Autoscroll until enough filters are in place, ymmv.
Clear (Ctrl+X): Clears/flushes captured activity.
Filter (Ctrl+L): Shortcut to the filter screen.
Highlight (Ctrl+H): Enable highlighting of particular captured activity.
Include Process From Window: You see a program you want to watch to see what it does, these cross-hairs will help you zero in on just it.
Registry Activity: I use this secondarily and have sparse experience with it, I tend to disable it on startup. Results include SUCCESS, NAME NOT FOUND, BUFFER OVERFLOW, REPARSE, NO MORE ENTRIES, ACCESS DENIED, and BUFFER TOO SMALL.
File System Activity: My bread and butter of this tool. Almost always will be using this. The seemingly more useful results include SUCCESS, ACCESS DENIED, NAME COLLISION, PATH NOT FOUND, END OF FILE, and BUFFER OVERFLOW, while the plethora of other results are NO MORE FILES, NAME NOT FOUND, FILE LOCKED WITH WRITERS, FILE LOCKED WITH ONLY READERS, NOT REPARSE POINT, PRIVILEGE NOT HELD, IS DIRECTORY, INVALID PARAMETER, NO SUCH FILE, RANGE NOT LOCKED, SHARING VIOLATION, OPLOCK NOT GRANTED, INVALID DEVICE REQUEST, and FAST IO DISALLOWED. This may not be the full list, but what I could generate.
Network Activity: This would be my 3rd most used, and last as I don’t use the next two. I like this to see if a connection was made out/in and to/from what host.
Process and Thread Activity
Profiling Events
*A note on Fast IO
“Fast IO indicators in a trace have to do with how the windows file cache works. Process Monitor provides a default filter that removes most of the Fast IO events, by doing an exclude on events that have an Operation starting with the string “FASTIO_”. This leaves “FAST IO DISALLOWED” events captured and displayed. You often see a “FAST IO DISALLOWED” entry on a file followed by the normal path attempt to open the file which succeeds. Adding a filter to exclude Operations start with “FAST IO” eliminates these red herrings.
When starting up the application, the output is overwhelming. Expect it, much like running Wireshark and showing all traffic on an interface, you are going to see more than you really need.
Filters
The default filter:

This strips out actions by the Process Monitor application itself. I use this as a base, and once the program starts showing results, exclude the imports I am not looking for. I rarely use the registry watch, and I typically stick to just the file monitor.
So for the default that loaded on the last version I downloaded, I would start the application,
to stop the capture, disable
,
, and
. I am then left with just
enabled. Now start the capture again,
.
For the slew of what is left, we have two options.
Include only the process by name or PID as a filter.
Pros: It is much cleaner and more direct if you know exactly what to look for. If I am trying to watch a single IIS Application pool, I can find its PID in the task manager, and add an Include for the matching PID.
Cons: This can exclude an item you had not anticipated, leaving a surprise to find out later.
Exclude Noise by Process name
Pros: Easier to start with when learning. Can reveal conflicting applications.
Cons: Time cost, this can be a 30+ list in some cases. Excluding that number of applications can take numerous runs of Process Monitor, starting and stopping captures to catch as much noise as one can.
I start excluding process’s by name for items I know I am not looking for.
Process Names’s I have been known to exclude:
In General:
System
Explorer.EXE
services.exe
scrnsave.scr
svchost.exe
mmc.exe
rundll32.exe
Desktop Environments:
trillian.exe
lync.exe
chrome.exe
firefox.exe
plugin-container.exe
FlashPlayerPlugin_11_5_502_135.exe
Nexus.exe
NOTEPAD.EXE
pn.exe
OUTLOOK.EXE
vmware-usbarbitrator.exe
FlashPlayerUpdateService.exe
GoogleUpdate.exe
putty.exe
Server Environments:
SSSvc.exe
TBD, As I run into further examples, I will flesh this out better.
Below, you’ll find a list of the most common IP commands for Windows and DOS. These include ipconfig, trace route, netstat, arp, route, hostname, control netconnections, and other popular DOS and Windows IP commands.
|
1 |
ipconfig /all |
|
1 |
ipconfig /displaydns |
|
1 |
ipconfig /flushdns |
|
1 |
ipconfig /release |
|
1 |
ipconfig /renew |
|
1 |
ipconfig /registerdns |
|
1 |
ipconfig /setclassid |
|
1 |
control netconnections |
|
1 |
netsetup.cpl |
|
1 |
ping whatismyip.com |
|
1 |
tracert |
|
1 |
netstat |
|
1 |
route |
|
1 |
arp |
|
1 |
hostname |
|
1 |
ipconfig /showclassid |
|
1 |
nslookup whatismyip.com |
Microsoft SQL Server backups, MSSQL Backup, process
The following command will generate a SQL script to back up all non system SQL databases. Be sure to replace the restore path. Make sure you set the results to text output.
|
1 2 3 4 5 6 7 8 |
use master GO select ' BACKUP DATABASE [' + [name] + '] TO DISK = N''C:\RESTORE\PATH\' + [name] + '.bak'' WITH NOFORMAT, NOINIT, NAME = N''' + [name] + '-Full Database Backup'' , SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO' from master..sysdatabases where dbid > 4 |
Once the above query has been run, copy the output and run it as a new query on the source server (I migrate a lot, hence the terminology used).
A basic example:
|
1 |
scp filename user@host.com:/path/where/you/want/it |
SCP
The scp command allows you to copy files over ssh connections. This is pretty useful if you want to transport files between computers, for example to backup something. The scp command uses the ssh command and they are very much alike. However, there are some important differences.
The scp command can be used in three* ways: to copy from a (remote) server to your computer, to copy from your computer to a (remote) server, and to copy from a (remote) server to another (remote) server. In the third case, the data is transferred directly between the servers; your own computer will only tell the servers what to do. These options are very useful for a lot of things that require files to be transferred, so let’s have a look at the syntax of this command:
|
1 |
scp examplefile yourusername@yourserver:/home/yourusername/ |
Looks quite familiar, right? But there are differences. The command above will transfer the file “examplefile” to the directory “/home/yourusername/” at the server “yourserver”, trying to get ssh acces with the username “yourusername”. That’s quite a lot information, but scp really needs it all. Well, almost all of it. You could leave out the “yourusername@” in front of “yourserver”, but only if you want to login on the server with your current username on your own computer. Let’s have a closer look at the end of the command. There’s a colon over there, with a directory after it. Just like Linux’s normal cp command, scp will need to know both the source file(s) and the target directory (or file). For remote hosts, the file(s)/directory are given to the scp command is this way.
You can also copy a file (or multiple files) from the (remote) server to your own computer. Let’s have a look at an example of that:
|
1 |
scp yourusername@yourserver:/home/yourusername/examplefile . |
Note: The dot at the end means the current local directory. This is a handy trick that can be used about everywhere in Linux. Besides a single dot, you can also type a double dot ( .. ), which is the parent directory of the current directory.
This will copy the file “/home/yourusername/examplefile” to the current directory on your own computer, provided that the username and password are correct and that the file actually exists.
You probably already guessed that the following command copies a file from a (remote) server to another (remote) server:
|
1 |
scp yourusername@yourserver:/home/yourusername/examplefile yourusername2@yourserver2:/home/yourusername2/ |
Please note that, to make the above command work, the servers must be able to reach each other, as the data will be transferred directly between them. If the servers somehow can’t reach each other (for example, if port 22 is not open on one of the sides) you won’t be able to copy anything. In that case, copy the files to your own computer first, then to the other host. Or make the servers able to reach each other (for example by opening the port).
Well, those are the main uses of scp. We’ll now go a bit more in-depth about the differences between ssh and scp.
*: Actually you can also use it just like the normal cp command, withhout any ssh connections in it, but that’s quite useless. It requires you to type an extra ‘s’ =).
Specifying a port with scp
The scp command acts a little different when it comes to ports. You’d expect that specifying a port should be done this way:
|
1 |
scp -p yourport yourusername@yourserver:/home/yourusername/examplefile . |
However, that will not work. You will get an error message like this one:
cp: cannot stat `yourport’: No such file or directory
This is caused by the different architecture of scp. It aims to resemble cp, and cp also features the -p option. However, in cp terms it means ‘preserve’, and it causes the cp command to preserve things like ownership, permissions and creation dates. The scp command can also preserve things like that, and the -p option enables this feature. The port specification should be done with the -P option. Therefore, the following command will work:
|
1 |
scp -P yourport yourusername@yourserver:/home/yourusername/examplefile . |
Also note that the -P option must be in front of the (remote) server. The ssh command will still work if you put -p yourport behind the host syntax, but scp won’t. Why? Because scp also supports copying between two servers and therefore needs to know which server the -P option applies to.
Another difference between scp and ssh
Unlike ssh, scp cannot be used to run a command on a (remote) server, as it already uses that feature of ssh to start the scp server on the host. The scp command does have an option that accepts a program (the -S option), but this program will then be used instead of ssh to establish the encrypted connection, and it will not be executed on the remote host.
Tips & Tricks with ssh and scp
Quite a handy thing about scp is that it supports asterisks. You can copy all files in a remote directory in a way like this:
|
1 |
scp yourusername@yourserver:/home/yourusername/* . |
And you can also just copy a whole directory by specifying the -r (recursive) option:
|
1 |
scp -r yourusername@yourserver:/home/yourusername/ . |
Both of these also work when copying to a (remote) server or copying between a (remote) server and another (remote) server.
The ssh command can come in handy if you don’t know the exact location of the file you want to copy with scp. First, ssh to the (remote) server:
ssh yourusername@yourserver
Then browse to the right directory with cd. This is essential Linux terminal knowledge, so I won’t explain it here. When you’re in the right directory, you can get the full path with this command:
|
1 |
pwd |
Note: pwd is an abbreviation of Print Working Directory, which is a useful way to remember the command.
You can then copy this output, leave the ssh shell by pressing Ctrl + D, and then paste the full directory path in your scp command. This saves a lot of remembering and typing!
You can also limit the bandwidth scp may use when copying. This is very useful if you’re wanting to copy a huge amount of data without suffering from slow internet for a long time. Limiting bandwidth is done this way:
|
1 |
scp -l bandwidthlimit yourusername@yourserver:/home/yourusername/* . |
The bandwidth is specified in Kbit/sec. What does this mean? Eight bits is one byte. If you want to copy no faster than 10 Kbyte/sec, set the limit to 80. If you want to copy no faster than 80 Kbyte/sec, set the limit to 640. Get it? You should set the limit to eight times the maximum Kbyte/sec you want it to be. I’d recommend to set the -l option with all scp’ing you do on a connection that other people need to use, too. A big amount of copying can virtually block a whole 10 Mbit network if you’re using hubs.
In some cases, FusionReactor may be behind a load balancer or CDN, or any other type of proxy that updates the source IP as seen by the server. It helps to see where the requests are actually originating from. For that, FusionReactor has an option for this:
http://www.fusion-reactor.com/support/kb/frs-351/
See the Requests>Settings>Proxy, which lets you tell FR that you need it to use some alternative header for the “real” ip address..
You will see that in the “proxy header” field there is a drop-down, but it doesn’t show your specific header, rather a couple of the most common alternatives. Just paste the name of your header into that field and save the configuration changes.
Once you have saved this change, you should be able to check the Requests>History page to confirm that you now see the real IP’s showing up.
First, you need your installation defaults, find the installer.properties example below:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
INSTALLER_UI=SILENT SILENT_LICENSE_MODE=full SILENT_SERIAL_NUMBER= SILENT_PREV_SERIAL_NUMBER= SILENT_INSTALLER_TYPE=standalone SILENT_INSTALL_ODBC=false SILENT_INSTALL_JNBRIDGE=false SILENT_INSTALL_ADMIN=false SILENT_INSTALL_SOLR=true SILENT_INSTALL_PDFG=true SILENT_INSTALL_FOLDER=/opt/coldfusion11 SILENT_ENABLE_PROD_SECURE_PROFILE=true SILENT_ENABLE_PROD_DEFAULT_PROFILE=false SILENT_ENABLE_DEV_PROFILE=false SILENT_ADMIN_IP=127.0.0.1 SILENT_JETTY_IP= SILENT_ADMIN_USERNAME=admin SILENT_ADMIN_PASSWORD=Adm1n$12 SILENT_ENABLE_RDS=false SILENT_RDS_PASSWORD=Adm1n$12 SILENT_JETTY_USERNAME=admin SILENT_JETTY_PASSWORD=Adm1n$12 SILENT_CONTEXT_ROOT= SILENT_AUTO_ENABLE_UPDATES=true SILENT_MIGRATE_COLDFUSION=false SILENT_PREV_CF_MIGR_DIR=/opt/coldfusion10 ENABLE_RDS=false ENABLE_WSRP=false ENABLE_JSDEBUG=false ENABLE_CFR=false ENABLE_CFSWF=false ENABLE_CFFORMS=false |
With this file, you can install ColdFusion 11 with the following:
|
1 |
./ColdFusion_11_WWEJ_linux64.bin -f installer.properties >> CF11Installer.log |
The output in the log file should look something like this:
|
1 2 3 4 5 6 7 |
Preparing to install... Extracting the JRE from the installer archive... Unpacking the JRE... Extracting the installation resources from the installer archive... Configuring the installer for this system's environment... Launching installer... |
Chown the CFIDE:
|
1 |
chown -R nobody:nobody /opt/coldfusion11/cfusion/wwwroot/CFIDE |
Backup your license.properties:
|
1 |
cp /opt/coldfusion11/cfusion/lib/license.properties /opt/coldfusion11/cfusion/runtime/lib/license.properties |
Add the service:
|
1 |
sh /opt/coldfusion11/bin/cf-init.sh install |
If the above does not exist, and well hey, it didn’t for me, I did write another article with the file needed. Check that Article out.
sconfig wants the “real” hostname or the connector won’t install.
|
1 2 |
cp /etc/hosts /etc/hostsbackup.$$ echo 127.0.0.1 localhost.localdomain localhost `hostname` > /etc/hosts |
Turn the listen flag to false in the license.propterties:
|
1 |
perl -pi -e 's/listen=true/listen=false/' /opt/coldfusion11/cfusion/lib/license.properties |
Start ColdFusion:
|
1 |
/opt/coldfusion11/cfusion/bin/coldfusion start && sleep 10 && |
Perform the wsconfig:
In my example, I happened to run the command twice, with varied setups. I am documenting them both and will clean up at next install:
|
1 2 |
/opt/coldfusion11/cfusion/runtime/bin/wsconfig -ws apache -dir /usr/local/apache/conf -bin /usr/sbin/httpd -script /etc/init.d/httpd >> CF11Installer.log /opt/coldfusion11/cfusion/runtime/bin/wsconfig -ws apache -dir /usr/local/apache/conf -bin /usr/sbin/httpd -script /etc/init.d/httpd -ws64 -apxs -norestart -v >> CF11Installer.log |
After the above, my CF11Installer.log added the following:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
The Apache connector was installed to /usr/local/apache/conf Usage: To use the GUI: java -jar wsconfig.jar To use the property file to specifiy options: java -jar wsconfig.jar -f <property-file-path> To use the command line to specify options: java -jar wsconfig.jar [options] Options To install the web server connector: -ws <IIS|Apache> -dir <path> | -site <site> [-host <hostname>] | [-cluster <clustername>] [-norestart] [-v] [-cfide [<dir>]] [-bin <path>] [-service <servicename>] (Apache/Windows only) [-bin <path>] [-script <path>] (Apache/UNIX only) To remove the web server connector: -remove -ws <IIS|Apache> -dir <path> | -site <site> [-v] To remove all the web server connectors: -uninstall [-v] To upgrade the web server connector: -upgrade -ws <IIS|Apache> -dir <path> | -site <site> [-v] To upgrade all the web server connectors: -upgrade [-v] To list the configured web servers: -list [-ws <IIS|Apache>] To get this help: -help Descriptions -ws <IIS|Apache> web server -dir <path> Apache conf directory -site <site> IIS web site name or number -host <hostname> ColdFusion server address (default=localhost) -cluster <clustername> ColdFusion cluster name -norestart do not restart web server -cfide [<dir>] CFIDE Directory Path -service <servicename> Apache Windows service name -bin <path> Apache server binary file -script <path> Apache Unix control script file -ws32 used to configure 32-bit web server on 64-bit Windows, Linux, and Mac OS. -reuseConnectionCount The reuseConnectionCount property sets the maximum number of connections that can be re-used in the connection pool. -connectionPoolTimeout The connectionPoolTimeout property sets the number of seconds to wait for the idle connection to close. -isWebServiceON The isWebServiceON property signifies that the Apache web server is started with the WEBSERVICE_ON property. Applicable only for Mac OSX 10.8 or higher. -allowedIPList The allowedIPList property represents an allowed IP address list(separated by comma) that access the restricted list of ColdFusion URLs. |
Performing the wsconfig generated the file I needed to move forward, /usr/local/apache/conf/mod_jk.conf to which the contents are below:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# Load mod_jk module LoadModule jk_module "/opt/coldfusion11/config/wsconfig/1/mod_jk.so" # Where to find workers.properties JkWorkersFile "/opt/coldfusion11/config/wsconfig/1/workers.properties" JkMountFile "/opt/coldfusion11/config/wsconfig/1/uriworkermap.properties" JKIPRestrictionFile "/opt/coldfusion11/config/wsconfig/1/iprestriction.properties" # Where to put jk logs JkLogFile "/opt/coldfusion11/config/wsconfig/1/mod_jk.log" # custom environment variables JkEnvVar REDIRECT_URL JkEnvVar REDIRECT_REMOTE_HOST JkEnvVar REDIRECT_PATH JkEnvVar REDIRECT_QUERY_STRING JkEnvVar REDIRECT_HTTP_ACCEPT JkEnvVar REDIRECT_HTTP_USER_AGENT JkEnvVar REDIRECT_REMOTE_ADDR JkEnvVar REDIRECT_SERVER_NAME JkEnvVar REDIRECT_SERVER_PORT JkEnvVar REDIRECT_SERVER_SOFTWARE # Where to put jk shared memory JkShmFile "/opt/coldfusion11/config/wsconfig/1/jk_shm" # Set the jk log level [debug/error/info] JkLogLevel info # Select the timestamp log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " AddHandler jakarta-servlet .cfm .cfml .cfc .cfr .cfswf DirectoryIndex index.cfm Alias /CFIDE "/opt/coldfusion11/cfusion/wwwroot/CFIDE" <Directory "/opt/coldfusion11/cfusion/wwwroot/CFIDE"> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> <Files ~ ".hbmxml$"> Order allow,deny Deny from all </Files> |
I then distilled the changes to ensure cPanel was copacetic with them, regenerated the conf and restarted apache:
|
1 2 3 |
/usr/local/cpanel/bin/apache_conf_distiller --update /usr/local/cpanel/bin/build_apache_conf /etc/init.d/httpd restart |
During the last step, I did open for editing /usr/local/apache/conf/httpd.conf twice and /usr/local/apache/conf/mod_jk.conf once before distilling and restarting again.
Edit the neo-security.xml and throw in some good defaults.
set rds.security.usesinglerdsp to false
set allowconcurrentadminlogin to false
set admin.userid.required to true
set allowedAdminIPList to 127.0.0.1 and an any others of importance
set secureprofile.enabled to true
The admin.userid.root.salt string may need to be updated, idk.
Restart the CF’s
/opt/coldfusion11/cfusion/bin/coldfusion stop
/opt/coldfusion11/cfusion/bin/coldfusion start
I had to switch out a certificate on a server and got the below error messages, documented here to make this familiar int he future. I was worried that it would break the other sites on the server, 2 others using the old certificate. Instead the server updated the certificate on all 3 and all 3 remained up and running. I could swear that is not how it happened in the past, but this may have been a different case.
Edit Site Binding
At least one other site is using the same HTTPS binding and the binding is configured with a different certificate. Are you sure that you want to reuse this HTTPS binding and reassign the other site or sites to use the new certificate?
Edit Site Binding
The certificate is associated with this binding is also assigned to another site’s binding. Editing this binding will cause the HTTPS binding of the other site to be unusable. Do you still want to continue?