Remove the quarantine extended-attribute on downloaded file or folder:
File:
sudo xattr -c -r /path/to/file
Recursively on folder:
sudo xattr -c -r /path/to/folder_containing_the_app_file
Afterward, the command "ls -l@" on the directory should no longer display the @ attribute on the directory or the contained files.
(Note also that the "xattr" utility (/usr/bin/xattr) is actually a Python script. I also understand that it specifically requires the use of Python 2.7.)
- Mac OS X command for Mac file copying including related resource fork file and permission preservation:
ditto [source] [destination] (* Like copying via the Apple Finder)
- Mac OS X command to determine the currently installed JRE version:
java -version
- The following 2 commands will make the hidden files (files that start with a dot) visible from the Apple Finder:
defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder
The second command will re-start the Finder. Once restarted the hidden files will be visible.
- Check if a MAC OSX system is 64-bit capable:
/usr/sbin/sysctl -n hw.cpu64bit_capable
- Commands to reliably determine current shell type on Linux, Mac and Solaris
(because "echo $SHELL" doesn't always give you the correct information)
- Command on Linux and Mac OS X to see the status of active TCP/IP ports on a system:
- Command that an be used to stop Linux firewall to test to see if license manager connection is blocked by firewall. Should start firewall back up again after done testing.
- Mac OS X steps to get equivalent of a stack trace for an IDL session (11/21/2017 - ju)
Here's a method for getting system call information from the customer's IDL session by doing the following (assumes a bash shell):
1. Open *two* XQuartz xterm windows.
2. In xterm #1 open a root shell with the command:
sudo -s
3. In xterm #2, source the idl_setup.bash script:
source /Applications/harris/idl86/bin/idl_setup.bash
4. In xterm #1, enter the command:
dtruss -as -W idl > /Users/joeuser/dtruss_out.txt 2>&1
where the customer should use their actual home directory name instead of "joeuser".
5. Then in xterm #2 issue the command:
idl
After the IDL session dies, the system call output should be in the output file to send to tech support for examination.
- Linux: Encode a binary executable file into an alphanumeric stream and then decode back to binaray using utility "base64":
Encode from binary to alphanumeric stream:
base64 mybinary > mybinary.txt
Decode resulting alphanumeric stream back to the original binary:
base64 -d -i mybinary.txt > mybinary
Then give the resulting file execute permission before running the program:
chmod +x mybinary
mybinary
LINUX:
Both of the following may be generally relevant but also useful for shared memory usage issues, but also for IDL_IDLBridge, semaphores, threading, and ESE issues
Shared memory usage commands:
ipcs
ipcs -l
ipcs -u
User resource limits:
ulimit -a <-- bash
limit <-- tcsh or csh
ulimit -n 4096 <-- If allowed by the system, increases the number of file descriptors to 4096
Permanently open TCP listening port 7070 in firewall from command line on CentOS 7
firewall-cmd --get-active-zones
firewall-cmd --zone=public --add-port=7070/tcp --permanent
firewall-cmd --reload
firewall-cmd --get-active-zones
firewall-cmd --list-all
Possible approaches to see if TRACE(TRACK) is enabled (potential security vulnerability) on HTTP or HTTPS server
curl -v -X TRACE http://www.yourserver.com
curl --insecure -v -X TRACE https://www.google.com/
JAVA:
Java Installation Home Directory
(In the context of the new Flexera License Server (2016), from the "java.home" location, if "./bin/javac" exists then you should consider this the JAVA_HOME directory. If only "./bin/java" exists then this would be the JRE_HOME directory.)
* One way to try to find the Java installation directory location of "java" command (ju 8aug2016):
java -XshowSettings:properties -version
Linux:
For example (bash -- redirecting stderr to stdout):
$ ./java -XshowSettings:properties -version 2>&1 | grep java.home
java.home = /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64/jre
Windows:
For example, from a Windows Command Prompt window:
java -XshowSettings:properties -version 2>&1 | find "java.home"
Java Installation Bit Version
* To find the bit-version of the Java installation, run the command:
java -version
If the result indicates a 64-bit version then it is 64-bit Java. If no bit-version is indicated then the Java installation is 32-bit. Example output from a 64-bit Java installation:
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
==================
PYTHON:
-----------------------
To install additional Python packages to your Anaconda installation using conda from within the Harris network, you'll first need to disable SSL verification:
conda config --set ssl_verify false
To reenable SSL verification:
conda config --set ssl_verify false
-----------------------
=================
DOS COMMANDS
=================
Send a file to a network printer:
print /d:\\printsrv\flr3prt3 myfile.txt
print /d:\\printsrv\flr3prt3 mybinarypsfile.ps
Run a program without invoking a new DOS shell window:
START "[a-title-string]" [path-to-windows-executable][executable-arguments]
===============================
* Change Windows process priority on the fly using WMIC command *
The command line syntax:
wmic process where name="AppName" CALL setpriority ProcessIDLevel
The customary notepad example setting it to "Above Normal":
wmic process where name="notepad.exe" CALL setpriority 32768
NOTE: Be careful setting the priories higher than normal because it could cause problems with system critical processes.
Idle: 64
Below Normal: 16384
Normal: 32
Above Normal: 32768
High Priority: 128
Real Time: 256
===============================
* Windows XP: Get the file path of a running executable with WMIC
See also Microsoft article:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wmic.mspx?mfr=true
For example:
C:\>wmic
wmic:root\cli>PROCESS WHERE (Description="idl.exe")
Caption CommandLine CreationClassName CreationDate CSCreationClassName CSName Description ExecutablePath ExecutionState Handle HandleCount InstallDate KernelModeTime MaximumWorkingSetSize MinimumWorkingSetSize Name OSCreationClassName OSName OtherOperationCount OtherTransferCount PageFaults PageFileUsage ParentProcessId PeakPageFileUsage PeakVirtualSize PeakWorkingSetSize Priority PrivatePageCount ProcessId QuotaNonPagedPoolUsage QuotaPagedPoolUsage QuotaPeakNonPagedPoolUsage QuotaPeakPagedPoolUsage ReadOperationCount ReadTransferCount SessionId Status TerminationDate ThreadCount UserModeTime VirtualSize WindowsVersion WorkingSetSize WriteOperationCount WriteTransferCount
idl.exe "C:\Program Files\Exelis\IDL82\bin\bin.x86\idl.exe" Win32_Process 20121224154854.068993-420 Win32_ComputerSystem TEKXP32 idl.exe C:\Program Files\Exelis\IDL82\bin\bin.x86\idl.exe 1984 46 468750 1413120 204800 idl.exe Win32_OperatingSystem Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition2 283 139878 723 1040384 2096 1040384 32423936 2879488 8 1040384 1984 3240 30008 3376 34036 65 17269 0 4 156250 29655040 5.1.2600 2879488 41 329
wmic:root\cli>
=======================================================
Windows 7 (and later?) - How to re-map .pro and .sav file name extensions
to open with the appropriate version IDL and IDL RT executables
=======================================================
To see what program version is associated to .pro and .sav files on your system, from a Windows Command Prompt window, issue the 2 commands:
ftype IDLprogramFile
ftype IDLbinaryFile
To remap the .pro and .sav file extension to a different version of IDL, from Windows Command Prompt window running as Administrator (e.g., for IDL 8.5):
ftype IDLprogramFile="C:\Program Files\Exelis\IDL85\bin\bin.x86_64\IDLSnapFileOpen.exe" "%1"
ftype IDLbinaryFile="C:\Program Files\Exelis\IDL85\bin\bin.x86_64\idlrt.exe" "%1"
Also, if needed, the ASSOC command shows the current file name extension association to a program reference, for example:
C:\Users\joeuser> assoc | find ".sav"
.sav=IDLbinaryfile
and can also be used to establish a connection to the program reference (although we would normally assume that this is already defined), for example:
ASSOC .sav=IDLbinaryfile
=======================================================
Windows: How to change the default "idlde" command used with Start
command from command prompt (e.g.: "start idlde") or from Start
menu > Run interface?
=======================================================
For example, for IDL 8.5, running PowerShell as Administrator, issue the following 2 commands:
set-itemproperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\App Paths\idlde.exe" -name "(Default)" "C:\Program Files\Exelis\IDL85\bin\bin.x86_64\idlde.exe"
set-itemproperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\App Paths\idlde.exe" -name "Path" "C:\Program Files\Exelis\IDL85\bin\bin.x86_64\"
Windows: How to enable executable to listen through firewall from command prompt:
netsh advfirewall firewall add rule name="My App" dir=in action=allow program="C:\Path\to\myapp.exe" enable=yes
===============================
keywords: useful unix commands, to know, helpful unix commands