顯示具有 IT Support 標籤的文章。 顯示所有文章
顯示具有 IT Support 標籤的文章。 顯示所有文章

2025年9月25日 星期四

How to Change the Downloads Folder Location

 In windows:

  1. Open File Explorer Press Win + E or click the folder icon on your taskbar.

  2. Locate the Downloads Folder Find it under “This PC” or “Quick Access.”

  3. Right-click the Downloads Folder Select Properties from the menu.

  4. Go to the “Location” Tab This tab lets you change where the folder points.

  5. Click “Move…” Choose your new folder location. You can create a new folder if needed.

  6. Confirm the Move Windows will ask if you want to move existing files. Click Yes to transfer them.

  7. Click “Apply” and “OK” Your Downloads folder is now redirected to the new location.



2025年9月17日 星期三

VB6 + ODBC + Access MDB: Setup Tricks

1️⃣ ODBCAD32 (64-bit) vs ODBCAD32 (32-bit)

✅ Always use the 32-bit ODBC Administrator for VB6 compatibility.

2️⃣ User DSN vs System DSN

⚠️ If both exist with the same name, User DSN takes priority.

3️⃣ Logical Drive vs UNC Path

  • Mapped drives (e.g., G:): ➤ Session-specific; may disappear in elevated/admin mode. ➤ Not reliable for System DSNs.

  • UNC paths (e.g., \\Server\Share\YourDB.mdb): ➤ Always accessible across sessions and users. ➤ Recommended for both System DSNs and DSN-less connections.

🛠️ Use Registry Editor to manually set DBQ to a UNC path if the GUI doesn’t allow it.

🛠️ Manually Setting DBQ to a UNC Path in the Registry

When the ODBC Administrator (odbcad32.exe) doesn't allow UNC paths in the Select Database dialog, you can manually set the database path by editing the registry.

📍 Registry Location for System DSNs (32-bit):

Code
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ODBC\ODBC.INI\YourDSNName

🔧 Steps:

  1. Open Registry Editor (regedit.exe) as Administrator.

  2. Navigate to the key above, replacing YourDSNName with the name of your DSN.

  3. In the right-hand pane, look for a string value named DBQ.

    • If it doesn’t exist, right-click → New > String Value → name it DBQ.

  4. Double-click DBQ and enter your full UNC path:

    Code
    \\ServerName\ShareName\YourDatabase.mdb
    
  5. Close Registry Editor.

✅ Why This Works

  • The DBQ value tells the Access ODBC driver where to find the .mdb file.

  • UNC paths are session-independent and work reliably across users and privilege levels.

  • This bypasses the GUI limitation and ensures your VB6 app can connect without relying on mapped drives.


2019年9月13日 星期五

Use Fail2Ban to improve security

Fail2Ban is a security tools used to ban source IP address that attempt to gain access to a Linux server. It will scan the system (sub-system) log to trace for illegal access log.

Source: https://www.fail2ban.org/wiki/index.php/Main_Page

Postfix

The Postfix uses the /var/log/maillog for checking. The filter file is /etc/fail2ban/filter.d/postfix.conf.

Open Relay

To prevent open relay in log:

Sep 12 15:00:06 xxx postfix/smtpd[12025]: NOQUEUE: reject: RCPT from unknown[185.208.211.112]: 454 4.7.1 <martinlujan997@gmail.com>: Relay access denied; from=<united@ctinets.com> to=<martinlujan997@gmail.com> proto=ESMTP helo=<WIN-7O75RVKC0I6>
Sep 12 15:00:07 xxx postfix/smtpd[11939]: NOQUEUE: reject: RCPT from unknown[185.208.211.112]: 454 4.7.1 <martinlujan997@gmail.com>: Relay access denied; from=<cooper@ctinets.com> to=<martinlujan997@gmail.com> proto=ESMTP helo=<WIN-7O75RVKC0I6>

In the filter file, add the line:

^%(__prefix_line)sNOQUEUE: reject: RCPT from \S+\[<HOST>\]: 454 4\.7\.1 <\S*>: Relay access denied;.*$

2018年11月18日 星期日

Install vacation plugin on Roundcube Mail in Centos 7

The standard roundcubemail in Centos 7 epel repository is 1.1.2 (LTS) which does not have the plugin vacation included, you should install it manually. The document logged the course of installing the plugin as well as the problems encountered.

1) Install the vacation binary program

The Centos 7 does not have vacation program in the yum repository. So it needs to be download from the source, compile and install.

Download the latest stable release 1.2.7.1 and extract it with the following command:

# tar -xvf vacation-1.2.7.1.tar.gz


Now you can compile it. You need to have the development packages to do so. The following packages are required: gcc, gdbm-devel

# make
gcc  -g -Wall   -Xlinker -warn-common -D_PATH_VACATION=\"/usr/bin/vacation\" -o vacation vacation.c strlcpy.c strlcat.c rfc822.c -lgdbm

Install it:

#make install

install -s -m 755 vacation /usr/bin/vacation
install -m 755 vaclook /usr/bin/vaclook
install -m 444 vacation.man /usr/man/man1/vacation.1
install: cannot create regular file ‘/usr/man/man1/vacation.1’: No such file or directory
make: *** [install] Error 1

There is an error encountered when installing the man files. The reason is it tries to install the man files into /usr/man instead of the /usr/share/man. So you need to edit the Makefile with the follow amendment:

MANDIR          = $(PREFIX)/man/man MANDIR          = $(PREFIX)/share/man/man

Then do the installation again:

#make install
install -s -m 755 vacation /usr/bin/vacation
install -m 755 vaclook /usr/bin/vaclook
install -m 444 vacation.man /usr/share/man/man1/vacation.1
install -m 444 vaclook.man /usr/share/man/man1/vaclook.1

2) Install Roundcube vacation plugin

There are four sources of vacation plugin:

https://github.com/rplessl/roundcube-vacation-plugin (last active is 2018-7-11)

https://github.com/bhuisgen/rc-vacation (last active is 2018-10-24)

https://github.com/gabor-toth/roundcube-vacation-plugin (last active is 2018-2-1)

https://sourceforge.net/projects/rcubevacation/ (last active is 2015-8-20)

Except the second one (rc-vacation), all the rest are alike. I've tried to install the second one, but no luck, it requires to install some modules which are beyond my knowledge. Blah, blah, blah....

Requirements :
- jQuery UI for vacation date support.
- PEAR Net/LDAP2 module for LDAP driver.

I finally select the first one  (rplessl).

Download and unzip it to the directory:  /usr/share/roundcubemail/plugins/

Rename the folder from roundcube-vacation-plugin-master to vacation for simplicity.

Now edit the file config.ini to select the driver (the method to update the auto-reply and forward rule). Since the default method is "sshftp" which is the one I preferred. So, no need to be modified.

[default]
driver = "sshftp"
subject = "Default subject"
body = "default.txt"

However, according the the document, if the imap (default) server is not the same as the smtp (postfix) server, you can change the parameter "server =", so that the .forward file in the home directory can be updated.

Now set the config.ini to be apache group readable:

# chown 0440 config.ini
# chgrp apache config.ini

Next modify the file /etc/roundcubemail/config.inc.php to activate the plugin:

// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('vacation');

After this, you will see the vacation icon in roundcube menu.


However, when clicking on the item, a blank page appears. It is due to an internal error when executing the plugin. To see what is wrong, you need to increase the debug level in /etc/roundcubemail/config.inc.php to 4.

// ----------------------------------
// LOGGING/DEBUGGING
// ----------------------------------
// system error reporting, sum of: 1 = log; 4 = show, 8 = trace
$config['debug_level'] = 4;

Afterwords, you will see the error in the page:

Fatal error: Call to undefined function ssh2_connect() in /usr/share/roundcubemail/plugins/vacation/lib/sshftp.class.php on line 29

Well, it complains about the ssh2 module is not installed. We install the required package:

# yum install php-pecl-ssh2

All done now!


2018年9月18日 星期二

The trust relationship between the workstation and the primary domain failed

In running a Windows domain environment, there are occasionally that a member workstation cannot log in with the following error prompted:


To fix the problem. Simply login as the local administrator, remove the current domain and join to a temporary workgroup. Reboot and re-join the domain. Reboot...and that is it!

Note that this method is the cleanest way and the user profiles in the workstation is preserved.


2015年3月10日 星期二

Synology Diskstation: How to avoid junk mail drop into junk folder

It seems rather odd in the title. However, the problem arises when the email client is using POP, the server side's junk folder cannot be accessed without using the web client (Roundcube). Normally, there are two solutions for the case, i) disable the spam control function in the server; ii) add into the white list. Both of them have their disadvantages and I have found another alternative: let the problem emails still have the "SPAM" marks but keep in the inbox so that users can read them via their email clients.

There are few documents around the Internet to tell how to do it. After studying for sometime, I finally found our the methods (works in DMS 4.3). The component related is a little Dovecote plugin called "Sieve". Which it has a little script to do the work:

/volume1/@appstore/MailServer/scripts/sieve_before/move_spam.sieve

The script is somthing look like:

require "fileinto";

if header :contains "X-Spam-Flag" "YES" {
         fileinto "Junk";
}

The script means that whenever the SPAM engine marked the email as junk, the plugin will move it from the inbox to the junk folder. Just use the "#" comment marks to comment the lines will do the job. Is it simple? However, I really spent more than an hour to find the solution!

Also there is a file called "move_spam.svbin" in the folder, It is the compiled file and just leave it there. It will be recompiled automatically whenever there are changes in the above script file.

Reference:

http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples