Windows: Connect Network Drive and Copy Remote Files at Login






Step 1. Write the batch script.

@echo off
net use N: \\\Media



Step 2. Wrap the batch script into a VBS script.

I wrote the following script in a file called picture_sync_wrapper.vbs:

Set shell = CreateObject(“WScript.Shell”)
shell.CurrentDirectory = “C:\Users\Dave\bin”
shell.Run “picture_sync.bat”,0,True

Q. Why write a VBS script?

Step 3. Drop the VBS script in your user’s startup directory




DKMS: version magic $old_kernel mod_unload modversions should be $new_kernel

Upgrading from Ubuntu 16.10 to 17.04, I found that the wireless usb dongle built with DKMS to use the 8812au module no longer works. ‘dmesg’ shows the following error:

[  429.307856] 8812au: version magic '4.8.0-46-generic SMP mod_unload modversions ' should be '4.10.0-19-generic SMP mod_unload '

Checking my current DKMS status, I see two kernal versions for the 8812au:

dave@desktop:~$ dkms status
8812au, 4.2.2, 4.10.0-19-generic, x86_64: installed
8812au, 4.2.2, 4.8.0-46-generic, x86_64: installed

This should work, but it does not…The root cause looks to be that while the driver was upgraded for the new kernel, its code was not updated to reflect the new version number.

The fastest way I found to fix this was to nuke all versions of the 8812au module, and reinstall.

1. Delete all version of 8812au

dave@desktop:/usr/src/8812au-4.2.2$ sudo dkms remove 8812au/4.2.2 --all

2. Reinstall the module with DKMS

dave@desktop:/usr/src/8812au-4.2.2$ sudo dkms install -m 8812au -v 4.2.2

You should not be able to plugin your device and confirm it is now working:


[  201.755249] usb 3-3.3: SerialNumber: 123456


[ 1032.071975] usb 3-3.3: USB disconnect, device number 11
[ 1033.575992] usb 3-3.3: new high-speed USB device number 12 using xhci_hcd
[ 1033.676357] usb 3-3.3: New USB device found, idVendor=0bda, idProduct=8812
[ 1033.676358] usb 3-3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1033.676359] usb 3-3.3: Product: 802.11n NIC
[ 1033.676360] usb 3-3.3: Manufacturer: Realtek
[ 1033.676360] usb 3-3.3: SerialNumber: 123456
[ 1033.761077] usbcore: registered new interface driver rtl8812au

Display Chinese and Japanese Characters in Team Fortress 2

Playing TF2 on Linux is great, but Japanese characters fail to display by default. I found the following font package allows Chinese and Japanese characters to be displayed.

On Ubuntu 16.10:

sudo apt install fonts-wqy-zenhei

Other distros or older Ubuntu versions may refer to this package as “wqy-zenhei”.

The description of fonts-wqy-zenhei states this is a Chinese font, but it works for Japanese characters (Hiragana and Katakana) as well.

Please note this still does not fix the Japanese input issue.

問題：新しいシステム パーティションを作成できなかったか、既存のシステム パーティションが見つかりませんでした。





Postfix: Lost Connection After AUTH from Unknown

I thought I would give Windows 10 a try, and found that while any client can receive email from my mail server, sending mail via Submission (port 587) would always fail with the following error within mail.log.

Lost Connection After AUTH from Unknown

While I am not sure of the root cause (Something inside Windows), the fix requires enabling SMTPS on port 465.

1. Edit

$ sudo vi /etc/postfix/

2. Uncomment the following lines

#smtps     inet  n       -       n       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
smtps     inet  n       -       n       -       -       smtpd
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes

3. Restart Postfix

$ sudo /etc/init.d/postfix restart

Even on Windows 10, sending email from a Windows client does not play well with Submission (port 587), so it is better to use SMTPS.

Mount remote file shares on a wireless network.

Working with my Raspberry Pi, one issue I always had was mounting my remote Samba server after the wireless was up. There are a couple ways this can be completed, but I find a simple script running after the wifi is up to be the easiest. This works for both Redhat and Debian based Linux distros. Here are the steps I used.

1. Determine the SSID

dave@dai-pi-2:~$ iwconfig | grep ESSID
lo no wireless extensions.

eth0 no wireless extensions.

wlan0 IEEE 802.11bgn ESSID:"Daves-Network"

So my SSID is “Daves-Network”, with the interface of “wlan0”.

2. Add the following mount script under /etc/network/if-up.d/050mountsmb. In this case, I used 050mountsmb, with the header number being the order in which the script is run compared to other scripts in this directory.

if [ "$IFACE" = "wlan0" ]
    if iwconfig|grep -c "Daves-Network"
        sleep 10s
        sudo mount -t cifs // /mnt/backup -o username=dave,password="MySuperSecrectPassword",uid=1000,gid=1000

Breaking down the mount command:

  • We confirm the interface is “wlan0”
  • If we can then confirm the SSID “Daves-Network”, we then perform the mount.
  • is the Samba share IP
  • smb_mount will be the Samba share’s name.
  • /mnt/backup will be where the file share will be mounted.
  • The options will identify the user/password in order to access the share, and the user/group permissions for the share on the local device.
  • If the mount fails, try again in 10 seconds.


3. Secure the script

Since this script uses a password, you need to make sure only root has read/write access.

sudo chown root:root /etc/network/if-up.d/050mountsmb
sudo chmod 600 /etc/network/if-up.d/050mountsmb

That’s it! Now when the host is rebooted or the network reloaded, the share will be mounted after wifi is confirmed as up. If not, the script will sleep for 10 seconds and try again.

“The system is running in low-graphics mode” error upon Ubuntu Upgrade (Nvidia Graphics Card)

I found this issue today while upgrading my Ubuntu desktop from 14.10 to 15.04. The upgrade went by smoothly, until I rebooted and X failed to start with the dreaded error message: “The system is running in low-graphics mode”. I currently have a NVIDIA GeForce GTS 450, which is using the nvidia-304 driver. After digging around, I found that the file had been delete(?), so I took the following steps to recover.

  1. Assuming you cannot login to GUI, choose either the console terminal from the presented options, or drop to the terminal with (control)+(alt)+(f1)
  2. Ensure the latest driver is installed. You will need to reboot if this is required.
    $ sudo apt-get install nvidia-current
  3. Install the tool “nvidia-settings”. This will create the file.
    $ sudo apt-get install nvidia-settings
  4. Run the nvidia-settings command and restart.
    $ sudo nvidia-settings
    $ sudo shutdown -r
  5. Change permission of .Xauthority. This might not be required, but in my case, the .Xauthority in my user directory became owned by root, so this needed to corrected.
    $ sudo chmod $USER:USER ~/.Xauthority

Now back to playing some TF2 🙂






1. ビルドできるため、次のソフトをインストール


2. ドライバーのコードをダウンロードする

$ git clone

3. ドライバーをビルドする

$ cd rtl8812AU_8821AU_linux
$ make

4. ドライバーをインストール

$ sudo make install
$ sudo modprobe 8812au


Tagged with: ,

Configuring Japanese Input in Gnome (Debian/Ubuntu)


Step 0. (Optional) Setup Japanese Keyboard


Screenshot from 2014-10-12 23:25:27

Step 1. Install “ibus-anthy”


$ sudo apt-get install ibus-anthy

Step 2. ibus setup

Again from the terminal, run “ibus-setup”.

$ ibus-setup


Screenshot from 2014-10-12 23:22:31

Step 3. Test


Screenshot from 2014-10-12 23:33:08

Possible issues:

Issue 1. Cannot change between change and English


$ ibus-setup


Issue 2. Ibus is not starting on boot


Solution 1.  im-config


$ im-config

Screenshot from 2014-10-12 23:40:00

Solution 2. Startup Application


Screenshot from 2014-10-12 23:43:46


Working with ownCloud on Ubuntu

For the past couple of months, I have been working with ownCloud . For those who do not know, ownCloud is a program that you can run on top of a web server to create your own cloud.  For anyone who is running their own website, this package is a must.

This post is not how to get your personal cloud started, but more of a list of items I have found while working with this software. For now, this is a work in progress.

  1. Adding further directories to sync with ownCloud
    I am working on Ubuntu 14.04 at the moment, but I hope this is similar for all platforms. This assumes you have the ownCloud client installed on your computer.

    $ sudo apt-get install owncloud-client

    All your ownCloud local settings will be found in the following path:


    By default, it will sync all files placed in /home/$USER/ownCloud. This is set by the file /home/$USER/.local/share/data/ownCloud/folders/ownCloud. So say you want to have another path on your current system automatically sync to your ownCloud. Just create a new file in /home/$USER/.local/share/data/ownCloud/folders, or edit the current file. Using pictures as an example, I added the following:


    Now my picture path is syncing to /photos on my ownCloud!