Disable monitor blanking on Debian with LXDE for remote access using NoMachine and VNC
Edit file: /etc/xdg/lxsession/LXDE/autostart
Remove:
@xscreensaver -no-splash
Append:
@xset s noblank
@xset s off
@xset -dpms
Sources: https://raspberrypi.stackexchange.com/questions/752/how-do-i-prevent-the-screen-from-going-blank
Patch vSphere 5.5 Updates
https://kb.vmware.com/s/article/2008939
(OLD: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2008939)
http://www.v-front.de/2014/09/vmware-releases-vsphere-55-update-2.html
Search for string in file system in Linux
Search for the string ‘root’ in the entire filesystem
# grep -H -R root ./* | cut -d: -f1
Source: http://www.cyberciti.biz/faq/howto-search-find-file-for-text-string
Shrink qemu qcow2 files
Excerpt from source:
Windows Guest
1.Delete all unnecessary files, empty recycle bin
2.Defragment drive (you might need to do this several times, until you see it “compacted” well)
3.Use sdelete to zero free disk space. Please note that this operation
will cause that all drive free space will be filled by zero, so the
virtual machine image will grow to the maximum size.
Using command prompt
sdelete -c c:
Linux/FreeBSD Guest
# dd if=/dev/zero of=./zero bs=1M
# sync
# rm -f ./zero
Note, the bs parameter is important, since it greatly reduce time necessary to complete this task.
Host
Convert image to the same format that is currently is (e.g. qcow2 =>
qcow2)… during this procedure it will release unused space.
# qemu-img convert -O qcow2 w2k3.qcow2 w2k3-shrinked.qcow2
Source:
http://mindref.blogspot.com/2011/07/shrink-qcow2.html
Download sdelete from here:
https://technet.microsoft.com/en-us/sysinternals/bb897443.aspx
Find files larger than 50 megabytes in Linux
Find files larger than 50 megabytes
$ find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Reference: http://www.cyberciti.biz/faq/find-large-files-linux
Best compression using tar and 7z
Compress using tar and 7z
$ tar cf - <source folder/file> | 7z a -si <Destination archive>.tar.7z
$ 7z x -so yourfile.tar.7z | tar xf - -C target_dir
Reference:
1. http://askubuntu.com/questions/300097/how-do-i-create-tar-7z-file-from-the-command-line
2. http://askubuntu.com/questions/341628/how-to-extract-tar-7z-files-from-command-line
Converting OVA to QCOW2 for use with QEMU/KVM
Extract the .ova file
$ tar -xvf file.ova
Convert the .vmdk to .qcow2
$ qemu-img convert -O qcow2 file.vmdk file.qcow2
Reference:
Block Inbound for Ports 135, 445, 1028 and Ping (ICMP 8) for Windows 7, 2008 Server
For workstations/servers that are public Internet facing and do not have a hardware/software firewall solution, use Windows Firewall with Advanced Security and block port 135, 445, 1028 and PING (ICMP 8) . GRC’s Shields Up! shows these ports as being open.
Reference:
https://www.grc.com/x/ne.dll?bh0bkyd2
http://www.rackspace.com/knowledge_center/article/creating-an-inbound-port-deny-rule-for-windows-firewall-windows-2008
Check Linux with rootkithunter and chkrootkit
Debian Linux
# apt-get install chkrootkit rkhunter
OR
# aptitude install chkrootkit rkhunter
CentOS 6.x
# yum install chkrootkit rkhunter
Import Active Directory Domain Services Cmdlets
Open Powershell Prompt
PS C:\> Import-Module active*
PS C:\> Get-Command -Module active
Reference:
http://blogs.technet.com/b/heyscriptingguy/archive/2010/01/25/hey-scripting-guy-january-25-2010.aspx