XScreenSaver is available on linux-based X11 systems, including major
linux and BSD distributions, MacOS, iPhone, iPad and Android. It was
written by Jamie Zawinski and others.
See: https://www.jwz.org/xscreensaver/
This is a very nice introduction to Writing an Xscreensaver Module using Xlib.
Thursday, April 13, 2017
Sunday, July 24, 2016
Sharing files between Mac and Windows
Just bought a 2TB external harddrive, but it is in NTFS format and is compatible with Windows 10 only. To use it with Mac it needs to be reformatted.
The choice is FAT32 or exFAT.
FAT32 is the traditional simple format, supported by most OS. But it cannot be applied to a disk larger than 2TB. Single file size cannot be larger than 4GB.
exFAT is an extended format of FAT32. It allows file size larger than 4GB.
Some links:
[1] How to format external hard drives for Mac and Windows
[2] How to share an external drive between a Mac and a PC
[3] Difference between exfat and fat32
[4] What is exFAT and how is it different from FAT32
The choice is FAT32 or exFAT.
FAT32 is the traditional simple format, supported by most OS. But it cannot be applied to a disk larger than 2TB. Single file size cannot be larger than 4GB.
exFAT is an extended format of FAT32. It allows file size larger than 4GB.
Some links:
[1] How to format external hard drives for Mac and Windows
[2] How to share an external drive between a Mac and a PC
[3] Difference between exfat and fat32
[4] What is exFAT and how is it different from FAT32
Sunday, May 8, 2016
Wednesday, February 24, 2016
Allow SSI (Server Side Includes) on bluehost
The easy way [1] is to add a .htaccess file with this line:
AddHandler server-parsed .html
That's all you need.
Another way [2] is to parse html as PHP. For this, go to cPanel >> Apache Handlers. In the "Extension(s)" box, enter html and in the "Handler" box enter application/x-httpd-php, then click "Add".
[1] https://my.bluehost.com/cgi/help/257
[2] http://www.bluehostforum.com/showthread.php?2359-I-need-help-using-server-side-includes!!
AddHandler server-parsed .html
That's all you need.
Another way [2] is to parse html as PHP. For this, go to cPanel >> Apache Handlers. In the "Extension(s)" box, enter html and in the "Handler" box enter application/x-httpd-php, then click "Add".
[1] https://my.bluehost.com/cgi/help/257
[2] http://www.bluehostforum.com/showthread.php?2359-I-need-help-using-server-side-includes!!
Monday, February 22, 2016
Uninstall dropbox without losing files
Say you're stop using a computer, and need to stop sharing your dropbox files on this computer, or maybe to uninstall dropbox. How can you do it safely without losing files?
You need to unlink the computer with your dropbox account. Here is an article:
You need to unlink the computer with your dropbox account. Here is an article:
3 Easy Ways to Unlink a Computer from a Dropbox Account
Tuesday, January 19, 2016
Move MSSQL database file path
The solution if found at: https://msdn.microsoft.com/en-us/library/ms345408.aspx
The steps are:
1) Change file path:
ALTER DATABASE [db_name] MODIFY FILE ( NAME = [db_logic_name], FILENAME = '[new path]' )
2) Stop MSSQL server.
3) Move the file.
4) Restart MSSQL server.
That's all. Now you can check status by:
SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'[db_name]');
The steps are:
1) Change file path:
ALTER DATABASE [db_name] MODIFY FILE ( NAME = [db_logic_name], FILENAME = '[new path]' )
2) Stop MSSQL server.
3) Move the file.
4) Restart MSSQL server.
That's all. Now you can check status by:
SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'[db_name]');
Monday, October 5, 2015
Underscore "_" is a wild card match character in MSSQL
Besides '%', underscore '_' is also a wild card match character in MSSQL. This can lead to some very subtle bug.
Say your table name has underscore in it, e.g., there are 2 tables my_Tablename and my_WeirdTablename. You find table using 'name like %_Tablename', then you will get both tables, instead of the first one. This leads to hidden bugs that are hard to identify.
To fix this issue, use this: 'name like %[_]tablename'. The '_' char is escaped by quoting it with brackets.
Say your table name has underscore in it, e.g., there are 2 tables my_Tablename and my_WeirdTablename. You find table using 'name like %_Tablename', then you will get both tables, instead of the first one. This leads to hidden bugs that are hard to identify.
To fix this issue, use this: 'name like %[_]tablename'. The '_' char is escaped by quoting it with brackets.
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2026
(36)
-
▼
June
(19)
- C10K to C10M: from thread-per-connection model to ...
- Benchmark server performance
- Application server for php, python, java, node.js,...
- Application server for C++, Go and Rust
- Nginx as reverse proxy and load balancer
- Infrastructure running: nginx, apache, php, python...
- Flow chart of nginx+apache+uvcorn infrastructure
- Flow chart of apache+uvcorn infrastructure
- Uvicorn and Gunicorn
- What's deadsnakes PPA
- What's the optional lsb-core package
- Codex known logging bug
- Daemonsize a service
- Train text to image model, to generate images of c...
- Train a model based on OpenAI API
- Open port 8080 for WebSocket
- Add websocket support on Bluehost Ubuntu VPS for D...
- Install Claude Code on ubuntu VPS of Bluehost
- Install PostgreSQL on Mac
-
▼
June
(19)
