Posts

Change IP address using a batch script in Windows 10

Here's how to quickly change your IP address with a batch script in Windows. First, check the output of the "ipconfig" command. The command will print names of your network interfaces and their settings. Then, if your ethernet adapter is called "Ethernet", you can set it to DHCP with the following batch script: netsh interface ipv4 set address name="Ethernet" dhcp netsh interface ipv4 set dns name="Ethernet" dhcp pause If you create a .bat file from that and run it as administrator , your network settings will change to automatic (DHCP). Other useful netsh examples: Set your IP to 192.168.1.120 and subnet mask to 255.255.255.0 netsh interface ipv4 set address name="Ethernet" static 192.168.1.120 255.255.255.0 Set gateway address to be 192.168.1.1 netsh interface ipv4 set address name="Ethernet" gateway=192.168.1.1 Remove DNS server settings netsh interface ipv4 delete dnsserver name="Ethernet" all

How to remove extra items from the 'new' context menu in Windows 10

If you haven't cleaned it up yourself, chances are there are several useless and annoying items in the right-click "New" context menu. People rarely create Rich Text Documents for example. And I never create new LibreOffice document files with the right-click menu. Instead, I open LibreOffice and then do what I need. So here's how to get rid of some of these extra options in your Windows 10 right-click context menu. Remove New 'Avisynth Script' option The file extension is avs. With regedit, go to: Computer\HKEY_CLASSES_ROOT\.avs Delete the ShellNew folder. Remove New 'Rich Text Document' The file extension is rtf. Remove folder Computer\HKEY_CLASSES_ROOT\.rtf\ShellNew Remove New 'Bitmap image' The file extension is bmp. Remove folder Computer\HKEY_CLASSES_ROOT\.bmp\ShellNew Remove New 'OpenDocument Text' The file extension is odt. Remove folder: Computer\HKEY_CLASSES_ROOT\.odt\LibreOffice.WriterDocument.1\ShellNew Remove New 'OpenD...

How to fix the weird audio bug in Kingdom Come: Deliverance

Image
  Kingdom Come: Deliverance has a bug which makes the sound come out muffled or like the characters were talking far away or through a tunnel. This seems to be because the game thinks you are using multichannel surround sound. There seems to be no option to change the audio mode in-game. Instead, you should change your audio settings in Windows by following these directions: Press the windows key Type "Choose your output device" and select the search result. Select "Device properties" under the Output caption. Select "Additional device properties" This dialog will differ depending on your audio hardware. Go to the Advanced tab. There should be a selection for the default audio format. You should select something like this: 2 channel 44100 Hz audio. I had my Focusrite audio interface set up with 8 channels 24bit 44100 Hz, and that caused Kingdom Come to think I have surround sound. After changing the channel amount to 2 the audio started working correctly.

Using the backup-manager Linux utility

Here's a quick rundown of a simple backup-manager configuration. In addition to the basic tarballs, I set it up to backup the mysql database. I did not automate the backup process. I will use the configuration to backup stuff manually on a USB drive. I am also not using the upload functionality of backup-manager. These should be relatively easy to set up once you try out the manual process. Installation Installing backup-manager with apt-get is easy: sudo apt-get update sudo apt-get install backup-manager It will ask for some of the configuration. Don't worry about that now, we will change the configuration later. Disable unnecessary cron job (optional) With the following commands I found all the backup-manager files strewn across the system: updatedb locate backup-manager From there, I could see that backup-manager installed a cron job: /etc/cron.monthly/backup-manager-clean-upload-db As I am not using the upload jobs, I disabled that cron job. This should not be necessary. su...

Format a disk on Ubuntu command line

Make sure you have cfdisk installed: sudo apt-get update sudo apt-get install cfdisk Please note: this will erase your disk! Also note: your old data will be still readable after this. The data is not totally destroyed! If you want to make sure the data is destroyed, you have to shred the disk. Connect your drive if it is not connected. See the dmesg command to see which device it was attached to: dmesg This will show you for example messages about "sdd" Then use cfdisk to partition your disk: sudo cfdisk /dev/sdd Use the simple cfdisk interface to: Delete the old partition Make a new partition with type 83 "Linux" Write the partition table Quit After that, you need to create a file system on the disk. sudo mkfs.ext4 /dev/sdd1 This would create partition 1 on the disk /dev/sdd.

A simple iptables config example

Here's my super simple iptables config file. It will accept SSH, HTTP and ping (ICMP) from anyone. Other inward connections will be dropped. Outward connections or connections from the local host are not restricted in any way. *filter :INPUT DROP [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A OUTPUT -j ACCEPT COMMIT In order to have the config automatically load during boot, I recommend the package iptables-persistent. On Ubuntu or Debian you should be able to install iptables-persistent with the command sudo apt-get install iptables-persistent Now you can save your configuration to the persistent iptable rule file /etc/iptables/rules.v4 and load it with the command sudo iptables-restore < /etc/iptables/rules.v4 Note that if you are using fail2ban, you should stop the fail2ban serv...

Silencing lm-sensors alarms

This guide might help you configure your lm-sensors. This example is made using an Intel DH61AG motherboard. After installing lm-sensors on my Ubuntu machine, I had some strange readings and alarms in the sensors output: coretemp-isa-0000 Adapter: ISA adapter Physical id 0:  +37.0°C  (high = +82.0°C, crit = +102.0°C) Core 0:         +30.0°C  (high = +82.0°C, crit = +102.0°C) Core 1:         +31.0°C  (high = +82.0°C, crit = +102.0°C) nct6775-isa-0290 Adapter: ISA adapter Vcore:          +0.74 V  (min =  +0.00 V, max =  +1.74 V) in1:            +1.09 V  (min =  +0.00 V, max =  +0.00 V)  ALARM AVCC:           +3.34 V  (min =  +2.98 V, max =  +3.63 V) +3.3V:      ...