Thursday, August 27, 2020

Computer Software Notes

Windows

Change network setting with commands
netsh interface ip set address "Local Area Connection" static IP NetMask Gateway
netsh interface ip set dns "Local Area Connection" static DNS primary
netsh interface ip add dns "Local Area Connection" DNS index=2

Add Emacs to the right-click menu.  Add to the registry
[HKEY_CLASSES_ROOT\*\shell\Emacs\command]
@="\"C:\\Program Files\\emacs-22.3\\bin\\runemacs.exe\" \"%1\""

Emacs for windows needs the diff program to run ediff.  If cygwin is installed, in .emacs (setq exec-path (list "c:/cygwin/bin")) to use cygwin's diff.  Also set environment variable CYGWIN=nodosfilewarning.

Emacs over VNC sometimes could not use the Alt key, add the following to .emacs
;; Map Alt key to Meta
(setq x-alt-keysym 'meta)
For computer with with multiple networks, eg hardwire ethernet and WIFI.  To set the network order
Control Panel -> Network and Sharing Center -> Change adapter settings -> The hit Alt to get the menu and choose Advanced -> Advanced Settings.

Screen saver timeout may have to be changed in the registry
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control Panel\Desktop]
"ScreenSaverIsSecure"="0"
"ScreenSaveTimeOut"="900"

Microsoft mouse software Intellipoint messes up the left handed setting.  Uninstalled it.

Microsoft robocopy is a useful tool for backups. The command  "rmdir /s/q folder" is a much quicker way to delete a large folder than through Windows interface.  [Others have pointed out a combination of "del /f/s/q foldername > nul" and "rmdir /s/q foldername" is even faster.]

Xilinx USB cable does not install incorrectly with ISE 11.1.  Manually running the following solves the problem,
cd C:\Xilinx\11.1\common\bin\nt
wdreg -inf windrvr6.inf install

Xilinx Platform Studio 7.1 cannot coexist with ISE 11.1. The PATH environment variable should contain either 7.1 or 11.1.

Foxit Reader is a better PDF reader than Adobe Acrobat Reader.

Matlab "Failure to find requested data acquisition device: nidaqmx."  Run Matlab as Administrator.

The driver for Proflic PL2303 based USB to serial adapter uses much more interrupt time than others.

Windows 7 jump lists are in %AppData%\Microsoft\Windows\Recent\AutomaticDestinations, deleting the large files helps restoring the lists.

Windows 7 does not include hyperterminal; copy the following files from Windows XP.  Hyperterminal does run on Windows 7.
c:\Program Files\Windows NT\Hypertrm.exe
c:\Windows\System32\hypertrm.dll

Hyperterminal can send ascii code by pressing and holding down ALT and entering numbers from the numeric keypad (with Num Lock on) then releasing the ALT key.  The code is sent upon the release of the ALT key.

xfig on cygwin complains about missing fonts.
cp /usr/share/ghostscript/fonts/*l.pfb /usr/share/fonts/Type1
cat /usr/share/ghostscript/fonts/fonts.scale >> Type1/fonts.scale
Change the first line to the number of fonts listed.
Update the font database:
mkfontdir

com0com creates a pair of virtual com port.

Laptop PC generates excessive fan noise even when there is little user activity.  The solution is to create a power plan that uses passive cooling, which reduces CPU speed first before increasing fan speed.  Furthermore limits the maximum processor state to 75%; that reduces the CPU frequency.  Power Options -> Create a power plan -> Change plan settings -> Change advanced power settings -> Processor power management -> Maximum processor state .

Linux

To clone a linux system to a large disk.
cp -ax /olddisk/. /newdisk
sed 's/`vol_id --uuid /dev/olddisk`/`vol_id --uuid /dev/newdisk`/g' /boot/grub/grub.cfg > /newdisk/boot/grub/grub.cfg
grub-install --boot-directory=/newdisk/boot /dev/newdisk
sed 's/`vol_id --uuid /dev/olddisk`/`vol_id --uuid /dev/newdisk`/g' /etc/fstab > /newdisk/etc/fstab


To keep the xterm open after executing a command with -e option,
xterm -hold -e 'command' 

To set up a remote git repository from a local repository
#Remote machine: Create the bare repository
mkdir proj.git
cd proj.git
git --bare init

#Local machine:
git remote add origin ssh://remote-machine///repository/proj.git
git push origin master
git checkout origin/master
#Create the local "master" branch that is tracking the "origin/master" branch
git branch -f master origin/master
git checkout master


To make an existing branch tracking a remote branch
git branch --set-upstream master origin/master

To fix a problem with acroread menu on Ubuntu,
"export UBUNTU_MENUPROXY="acroread":$UBUNTU_MENUPROXY
or disable global appmenu altogether
sudo sh -c "echo export UBUNTU_MENUPROXY=0 > /etc/X11/Xsession.d/81ubuntumenuproxy"

When partition a USB drive for Linux and Windows, place the Windows partition first.   Windows can only read the first partition from a USB drive.  The Linux can boot from the second partition.

To map the mouse buttons in X Windows
xinput list
xinput set-button-map 12 1 2 3

To create a pair of virtual serial ports 
socat -d -d pty,raw,echo=0 pty,raw,echo=0

The password length and complexity are controlled by
/etc/pam.d/common-password

The hardware clock setting is in /etc/default/rcS
UTC=yes
to set to UTC time.

Environment variables for Desktop, .pam_environment, the following may be needed to prevent undesirable scaling
QT_AUTO_SCREEN_SCALE_FACTOR=0

No comments:

Post a Comment