On the opposite sex …

Some interesting paraphrased quotes on the opposite sex from Chinese films.

“Men will treat you well because you have value. As that value diminishes, you’ll see they’ll stop.” -paraphrased from The Enchanting Phantom

“Women all know how to trick people (men). The prettier they are, the better they are at it.” -paraphrased from Heavenly Sword, Dragon Saber.

张馨予 Zhang Xinyu (Viann) as 康敏 Kang Min in The Demi-Gods and Semi-Devils 天龙八部. I normally root for the bad guys in the movies, but in this drama, this woman is pure evil, but so gorgeous. I get so excited to see her on screen, but I’m afraid to see what she does to people!
True! At least there’s no way I can!

How to clear the filesystem buffer cache in Linux

You would probably want to do this if you’re suspecting that there’s an issue where you’re falling short on memory, diagnosing performance issues, etc. It’s much faster than a reboot and if it solves your problem, you’ll know what to do in the future. It’s not likely that you’ll need to do this. Just good to know how.

If you’re interested in more information regarding your memory, you can go look at: https://www.linuxatemyram.com/

Taken from: https://stackoverflow.com/questions/29870068/what-are-pagecache-dentries-inodes

With some oversimplification, let me try to explain in what appears to be the context of your question because there are multiple answers.

It appears you are working with memory caching of directory structures. An inode in your context is a data structure that represents a file. A dentries is a data structure that represents a directory. These structures could be used to build a memory cache that represents the file structure on a disk. To get a directly listing, the OS could go to the dentries–if the directory is there–list its contents (a series of inodes). If not there, go to the disk and read it into memory so that it can be used again.

The page cache could contain any memory mappings to blocks on disk. That could conceivably be buffered I/O, memory mapped files, paged areas of executables–anything that the OS could hold in memory from a file.

The commands flush these buffers.

Every Linux System has three options to clear cache without interrupting any processes or services.

  1. Clear PageCache only.
    • # sync; echo 1 > /proc/sys/vm/drop_caches
  2. Clear dentries and inodes.
    • # sync; echo 2 > /proc/sys/vm/drop_caches
  3. Clear PageCache, dentries and inodes.
    • # sync; echo 3 > /proc/sys/vm/drop_caches

Explanation of above commands. sync will flush the file system buffer. Commands separated by “;” run sequentially. The shell wait for each command to terminate before executing the next command in the sequence. As mentioned in kernel documentation, writing to drop_cache will clean cache without killing any application/service, command echo is doing the job of writing to file. If you have to clear the disk cache, the first command is safest in enterprise and production as “…echo 1 > ….” will clear the PageCache only. It is not recommended to use third option above “…echo 3 >” in production until you know what you are doing, as it will clear PageCache, dentries and inodes. Is it a good idea to free Buffer and Cache in Linux that might be used by Linux Kernel? When you are applying various settings and want to check, if it is actually implemented specially on I/O-extensive benchmark, then you may need to clear buffer cache. You can drop cache as explained above without rebooting the System i.e., no downtime required. Linux is designed in such a way that it looks into disk cache before looking onto the disk. If it finds the resource in the cache, then the request doesn’t reach the disk. If we clean the cache, the disk cache will be less useful as the OS will look for the resource on the disk. Moreover it will also slow the system for a few seconds while the cache is cleaned and every resource required by OS is loaded again in the disk-cache. Now we will be creating a shell script to auto clear RAM cache daily at 2am via a cron scheduler task. Create a shell script clearcache.sh and add the following lines. #!/bin/bash # Note, we are using “echo 3”, but it is not recommended in production instead use “echo 1” echo “echo 3 > /proc/sys/vm/drop_caches” Set execute permission on the clearcache.sh file. # chmod 755 clearcache.sh Now you may call the script whenever you required to clear ram cache. Now set a cron to clear RAM cache everyday at 2am. Open crontab for editing. # crontab -e Append the below line, save and exit to run it at 2am daily. 0 2 * * * /path/to/clearcache.sh For more details on how to cron a job you may like to check our article on 11 Cron Scheduling Jobs. Is it good idea to auto clear RAM cache on production server? No! it is not. Think of a situation when you have scheduled the script to clear ram cache everyday at 2am. Everyday at 2am the script is executed and it flushes your RAM cache. One day for whatsoever reason, may be more than expected users are online on your website and seeking resource from your server. At the same time scheduled script run and clears everything in cache. Now all the user are fetching data from disk. It will result in server crash and corrupt the database. So clear ram-cache only when required,and known your foot steps, else you are a Cargo Cult System Administrator. How to Clear Swap Space in Linux? If you want to clear Swap space, you may like to run the below command. # swapoff -a && swapon -a Also you may add above command to a cron script above, after understanding all the associated risk. Now we will be combining both above commands into one single command to make a proper script to clear RAM Cache and Swap Space. # echo 3 > /proc/sys/vm/drop_caches && swapoff -a && swapon -a && printf ‘\n%s\n’ ‘Ram-cache and Swap Cleared’ OR $ su -c “echo 3 >’/proc/sys/vm/drop_caches’ && swapoff -a && swapon -a && printf ‘\n%s\n’ ‘Ram-cache and Swap Cleared'” root After testing both above command, we will run command “free -h” before and after running the script and will check cache. Clear RAM Cache and Swap Space That’s all for now, if you liked the article, don’t forget to provide us with your valuable feedback in the comments to let us know, what you think is it a good idea to clear ram cache and buffer in production and Enterprise? Sharing is Caring…

What’s NonRootPortBinding? I just want to run my web server on port 443!

In the Unix world, privileged ports are 1-1024. As a non-root user, you’re not allowed to start a service and listen on them.

So, how do web servers work then? They usually use ports 80 and 443.

There are a few ways around this. The most common is that the process is started as root and then downgraded.

If you want to start a process without ever having root access though, the way to do it is with NonRootPortBinding. You can find information about it using Apache here.

Basically, for any process you want to start on a port under 1025, you can run:

setcap cap_net_bind_service=+ep <path to binary> 

Following that, you can confirm that you’ve set the correct permission by running:

getcap <path to binary> 

It should return with: cap_net_bind_service+ep

When you patch or update the binary, you will need to rerun the setcap command.

Hope this helps!

Love and breakup and love again

Here are a couple of videos that I find profound and very interesting. Unsurprisingly, they’re videos from a couple of my favorite Chinese actresses.

The first one is with Li Yitong 李一桐. I’ve been a fan of hers since seeing her in The Legend of the Condor Heroes. http://www.iqiyi.com/lib/m_208895914.html. In this video, she does a great narrative about breakup. Please watch the video if you could. The gist of it is that you should enjoy what you have. While you’re enjoying it however, you might be too busy enjoying it that you’re not spending the time to cherish it. You also don’t think you’ll ever lose it. Over time, things change and people drift apart. For her, he had known all of her weaknesses, all but one. Her biggest fear however was knowing one day that she wasn’t able to marry the guy. Well, she’s gotten used to not having him. Moving on, she wishes him well, thanks him for the memories and thanks him for allowing her to love her. Basically, be grateful. How profound!

With Athena, this was a quick replay of A Chinese Odyssey Part One: Pandora’s Box 西遊記第壹佰零壹回之月光寶盒, a film that I’ve seen a couple of times and undoubtedly will watch at least couple more. Also about love – interesting that she says that if you’re not in a loving relationship, leave. There’s someone else out there that’s waiting for you. I certainly hope that’s true. I don’t know if it is, but I do think it’s a beautiful story.

Sorry there are no English subtitles. If you have a link with some, please let me know in the comments and I’ll update the link.

Using 2 ISPs at the same time, any routers!

I have another blog posting where I talk about how to use 2 ISPs at the same time and the router load balances the outbound connections.

Since then, I’ve upgraded my other Internet connection such that it’s not even worth keeping the other one. I now have one WAN link that’s over 500mbps and another that’s 20mbps. How do we load balance that? Why bother with the 20mbps? For that reason, I just unplugged it for months…

Then I thought about it and turned it back on. It was initially to be used as a backup, in case my primary goes down, which always does and comes back up again, but now, I use them both concurrently. Since I have an older router that was laying around, so it made my decision easy. If I didn’t have the extra router, I may not have gone out to buy another one.

Basically, the way I’m using it is like this:

192.168.0.1 is my primary router. It has my primary WAN link and all of my Internet traffic goes through it, with the exception of some DNS traffic.

Just a screenshot of my primary router settings. Why am I not using ASUS-Merlin? I don’t know. It didn’t support AImesh when I first set up the mesh. Merlin does now, but I keep thinking that I’ll be giving something up. Maybe I’ll do Merlin someday soon. I’ll be sure to blog about it if I do.

192.168.0.6 is my secondary router. This is where my hosts go to get Internet access if my primary goes down. Hopefully, the primary link doesn’t go down for an extended period of time. If it does, this is what I will use. I do need to manually configure my clients. Basically, just change it from automatic DHCP to manual and instead of using 192.168.0.1 as the default gateway, switch it to 192.168.0.6. I use the same DNS servers. I turn off DHCP on this router.

Very simple DD-WRT secondary router setup

DNS server – I have a separate caching DNS server that runs just to cache DNS requests. On it, I use forwarders to resolve DNS requests to avoid full recursive lookups if possible. To get to those forwarders, I put 1/2 of them through my primary ISP and 1/2 of them through the secondary.

My bind configuration options look like this:

forwarders {
    9.9.9.9;
    208.67.220.220;
    1.1.1.1;
    8.8.8.8;
    208.67.222.222;
};

My routing table looks like this:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 ens160
8.8.8.8 192.168.0.6 255.255.255.255 UGH 0 0 0 ens160
68.87.20.6 192.168.0.6 255.255.255.255 UGH 0 0 0 ens160
96.114.157.81 192.168.0.6 255.255.255.255 UGH 0 0 0 ens160
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens160
208.67.220.220 192.168.0.6 255.255.255.255 UGH 0 0 0 ens160

With this configuration, basically I’m just using 1 ISP for everything, with the small exception of DNS. When my primary ISP goes down, I don’t really think about DNS. Maybe I’ll check next time to see if DNS is still working. Usually when it goes down, I look at my router and see that my modem is likely rebooting.

Anyway, when I want to fail over to my 2nd ISP, I do it simply on the device like this:

When configuring manually, you’ll need to configure the DNS as well.

Hope this helps! Please leave any comments or questions below!

Don’t skip inutoc . !!! (AIX)

I’m not an AIX expert. I’ve only been on an AIX command line probably 3-4 hours at the most in my entire career.

I just know that when you’re installing AIX packages, make sure you run inutoc . I have some notes on AIX here.

Basically, after you copy an ipfl file into a directory, say /tmp, you will need to run the 2 commands like this:

inutoc .
installp -ac -gXY -d. ipfl

Otherwise the install will fail with some message that I can’t remember.

Binge watching the Condor Trilogy series

Thanks to the Corona virus, the people of San Francisco have been sheltered in. One of the things that I’ve enjoyed doing is watching the Condor Trilogy 射鵰三部曲 series. I got the idea of doing this because of nostalgia. I always enjoyed wuxia as a kid. I don’t know which I watched first – Bruce Lee or Chinese kung fu movies. For that reason, I didn’t even think Crouching Tiger, Hidden Dragon was that awesome when it first came out – thought it was just like another Chinese kung fu movie. Hero though, the film with Jet Li and Donnie Yen, was really awesome! I watched the The Return of the Condor Heroes 神鵰俠侶when I was a kid. My late aunt graciously recorded it for me and I watched while being babysat at my great-grandmother’s house. Only upon watching it for the 3rd time, this time in order without missing any episodes and with subtitles, did I really know how much of the story I missed and how poor my Cantonese is.

When I was a kid, I only cared to see the kungfu action. At least that’s what I thought I cared for. Having watched it very recently, I still enjoyed the kung fu action, but also really enjoyed the story. I also enjoyed seeing the lots of beautiful women cast in the series. It’s almost like watching the UFC actually. Which guy doesn’t like watching violence mixed with beautiful women? With the UFC or boxing, you have ring card girls. I know the movies aren’t real fighting. It’s more of a dance than a fight scene. If I want to watch real fighting, I’ll watch the UFC. That said, this is a series that has a remake every decade. Jin Yong wrote some masterpieces. There’s no other reason they would do a remake every 5-10 years.

So I spent about 30 hours watching the 1983 version of 神鵰俠侶 with Andy Lau and Idy Chan. I enjoyed the series a lot. Andy Lau plays brilliantly and Idy Chan is a goddess. Among them were many other talented and beautiful stars as well. I knew I had to watch it from from the beginning to the end to really understand the film. The moment I started watching the series, I started to notice that I needed to keep track of the characters so that I wouldn’t get lost in remember who was who. I ended up using wikipedia as Cliffs notes. I wish I had known about the fandom link at the time. I would’ve used it as well. I’m not the best at remembering Chinese names. I did my best, but also sadly couldn’t resist reading and finding out what happened prior to seeing it actually happen. It was still entertaining and exciting to see how the directors set up the scenes and how they were executed.

There’s a video below that talks about how they shouldn’t make these series because the ratings seem to be getting lower and lower. I might agree perhaps for the older series e.g. the 1990s and 2008, but would wholeheartedly disagree for the 2017/2019 versions. Also, the guy makes his argument based off of ratings. Well, ratings are based on the time and what was available at the time. If you watch the 1983 神鵰俠侶, you’ll see that the Jinlun Guoshi is wearing a wig that doesn’t match his skin color. You would also see that in a lot of scenes, the backdrops are terrible – totally obvious that it’s done on a set.


Think about it. Why would anyone in their right mind create a remake of a series, spend a shitload of money, and make a series that’s worse than the original? Nobody would. Nobody would invest. Nobody would play the parts. Unless they’re just milking the cow – if they already own something and just want to get as much money out of it as possible before it dies. I don’t think that’s the case with these series. You should expect that every series is better than the next. There are many reasons for that. If a series was successful, people usually would like to replicate that success somehow. With better technology and a bigger budget, they can often produce a better product as well. For example, back in 1984, the best they could do to simulate 小龍女 XiaoLongNu’s bees was to make little lights flash on screen. Technology has gone a long way since then.

At the end of the series, I had a decision to make. Did I want to see the prequel and sequels? Well, it was a resounding yes. Jin Yong can really tell a story! I had no doubt that I wanted to see the other 2 parts of the series. That said, there are about 3-4 different versions I could choose from. My first thought was to try the Amazon prime version. I watched 1 episode of the Legend of the Condor Heroes there and decided immediately that it wasn’t for me. My issue was that the English subtitles get superimposed over the Chinese subtitles and made it hard to read. Another issue was that I think they went overboard with the special effects and computer generated imagery. I guess you’ll never know how far you can go until you have crossed the line. I feel that the 2008 version did just that. I then watched 1 episode of the 2017 version and felt good with it. I’m glad I did.

李一桐 Li Yitong plays Huang Rong 黃蓉, one of the main characters in the Legend of the Condor Heroes. She won 2 well-deserved awards for her performance. I absolutely fell in love with her character. I was looking forward to her character to come on the entire time. She was super cute, witty, intelligent, the whole package. In an interview, they asked her if she had watched the previous drama series. I’m glad she didn’t. That’s not to say that her predecessors didn’t do a good job. The late Barbara Yung Mei-ling 翁美玲 and Athena Chu Yan 朱茵 are also fantastic in their respective versions of the series. I can’t pick a favorite because I’ve always been a huge fan of Athena Chu’s since her performance in A Chinese Odyssey. I’ve now also become a huge fan of 李一桐 Li Yitong!
The beautiful Athena Chu in the 1994 version of The Legend of the Condor Heroes.
Viola Mi 米露 plays a fantastic and underrated Mei Chao Feng 梅超風. Doesn’t she look like she came out of a comic book? Viola, clearly very attractive, looks fantastic as a goth villain. She plays the role of a blind woman pretty convincingly and I believe this is the best version of her costume as well. She switches from a master villain role to a subservient role well when the master Huang Yaoshi 黃藥師 shows up.
I haven’t seen a better version of the Seven Freaks of Jiangnan 江南七怪. These guys were not in the series that much, but at least you see the different characteristics of the different characters. In the 1983 version, apart from the leader Ke Zhen’e 柯鎮惡, it’s hard to tell one from the other.
陈星旭 Chen Xingxu looks totally innocent, doesn’t he? He plays a pretty good bad guy, 楊康 Yang Kang, switching to being a bro of Guo Jing. Heard from an interview that he was nervous about the role because the guy that played Huang Yaoshi played his role in 1983. Frankly, I think Chen did a better job, but Michael Miu 苗僑偉 played a very good Huang Yaoshi.
Meng Ziyi 孟子义 sure is beautiful, isn’t she? She plays 穆念慈 Mu Nianci. Internet says she had some plastic surgery.

After watching the The Legend of the Condor Heroes, I proceeded with watching Heavenly Sword and Dragon Slaying Saber. I figured I would go with the 2019 version since it was the latest and it didn’t disappoint. This is available on Amazon Prime video as well, but unfortunately only in Cantonese. Since the movie was filmed in Mandarin and I always prefer to see lips in sync, I opted to watch in Mandarin.

Chen Yuqi 陈钰琪 or Yukee Chen has also earned a fan in me. Her acting was superb and she earned 2 well-deserved awards for her performance as Zhao Min, the Mongolia princess.
See the source image

Bambi Zhu Xudan 祝绪丹 is gorgeous, isn’t she? She plays Zhou Zhiruo, a beautiful, sweet, and innocent woman. Does she look like she could kill anyone!? Well, she played a very convincing role when switching over and also deserved the 2 awards she won for her performance.

No way! You’re a total catch!
Watch a comparison of scenes here. I think it’s pretty clear that the remakes are better.
Here’s another comparison video.

I do have one complaint about the casting. There’s no shortage of talent in Hong Kong or China. Why do they reuse the same actors for different parts? The only reasons I can think of are budget or directors wanting to work with the same people. Here are some examples of some that look the same. There are more, but since the series are over a decade apart, the actors no longer look the same and they played the parts well. Kathy Chow Hoi-mei 周海媚 played Zhou Zhiruo in the 1994 Legend of the Condor Heroes series and played an awesome evil Abbess Miejue in the 2019 Heavenly Sword and Dragon Slaying Saber. Michael Miu played Yang Kang in the 1983 series and Huang Yaoshi in the 2017 Legend of the Condor Heroes series.

The same guy plays one of the Seven Freaks of Jiangnan in the 1980s version of the Legend of the Condor Heroes and then plays the 公孫止 character in the Passionless Valley.
The beautiful Li Zeng 曾黎 appears in both, The Legend of the Condor Heroes and Heaven Sword and Dragon Saber. I guess she commits suicide as Guo Jing’s mother 李萍 and then reincarnates as the Poison Goddess 王難姑 over 100 years later. I don’t mind seeing more of her by the way! She’s stunning!
Li Zeng in The Legend of the Condor Heroes. In my dreams, she’s married to me!
Ning Wentong plays 周伯通 in the Legend of the Condor Heroes and then plays 胡青牛in Heaven Sword and Dragon Saber.

Normally, when watching any drama series, after the whole thing, I feel like I’d wasted my time. After all, it is many hours of my life. After Breaking Bad, arguably one of the most successful series of all time, I felt like I had wasted many hours of my life and wish I hadn’t seen it. I felt the same after watching the IP Man tv series. The Donnie Yen movies were great. The series, not so much. I also watched many episodes of Boardwalk Empire – perhaps 1-2 seasons. At some point, I feel like it’s never going to end and I quit. This is one of the few series that I cannot seem to get enough of. Eventually, I may read the books, but now, I’m content with watching what I can on tv or YouTube and reading on wikipedia and fandom. The reason I feel that I could be critical about the different versions is because I actually went through the different ones that I’ve talked about and found my favorite scenes and watched them in the various versions. You can find almost all of them on Youtube.

If you do watch this series however, don’t watch it in the order that I watched it in, unless you want to know what happens later. It is a little fun to know how the characters already progressed, but I think it’s better to watch them in order. 🙂 Start with The Legend of the Condor Heroes 射鵰英雄傳, move on to The Return of the Condor Heroes 神鵰俠侶 and finish with The Heaven Sword and Dragon Saber 倚天屠龍記.

I can’t wait to see the New Return of the Condor Heroes starring 佟梦实 Thomas Tong and 毛晓慧 Mao Xiaohui.

Thanks for reading and please leave some comments below.

Rebroadcast your neighbor’s wifi for yourself (wifi extender) with Tomato firmware

My parents recently swapped Internet providers and since they didn’t know that it would take a week for the application to be completed, they were out of Internet service for about a week. The neighbors graciously allowed them to use theirs, but the signal didn’t reach the entire house. To make it reach, we configured the router to rebroadcast their wifi. If you’re going to be doing this, please make sure you get permission first!

The easiest way to do this is to just get one of those wifi extenders. We just didn’t happen to have any at the time. Since the router was Tomato compatible, I first flashed the router with tomato. The screenshots you’re seeing are Tomato by Shibby, just with a custom skin.

To do this, you first need to find out what IP address range you can use. I did this just by connecting a laptop to their wifi. Turned out that the IP address their DHCP server gave me was 192.168.7.x. I tried to ping 192.168.7.253 to make sure it wasn’t taken and sure enough, it wasn’t. I assigned 192.168.7.253 to my router.

Next, I needed to disable DHCP. You don’t want your DHCP competing with the neighbor’s. Lastly, use the default gateway that you get from their DHCP server. In my case, it was 192.168.7.1. You can use the DNS server from them also or you can use others. I like Quad9’s 9.9.9.9 or Cloudflare’s 1.1.1.1 or Google’s 8.8.8.8.

After that, you can match up your wifi settings with theirs’ so that it can connect. Use the exact same SSID, shared key, and use “Wireless Ethernet Bridge” for the Wireless Network Mode.

Lastly, optionally, you can put up any your own wifi settings as virtual wifi settings so that you don’t need to reconfigure any of your own devices.

The virtual setting is the wl0.1. Just add it and that’s it!

That’s all you need to do to make your own Tomato Wireless Extender. This has much better range than a regular wifi extender and was available at the time.

What in the hell is zypper!?

Had an issue recently with SUSE Linux where I saw this:

warning: /var/cache/zypper/RPMS/rpmname-9.3.0-6104.s12.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 7baa810c: NOKEY
Checking directory paths.

2019-11-16T10:29:00-05:00 Package installation failed

If you run into this, I would recommend:

  1. Run the command “zypper ref -s” to see if it would refresh the cache and service.
  2. Check if the quota exceeded on the server by reviewing the SUSE knowledge base article: https://www.suse.com/support/kb/doc/?id=7017376

Don’t travel without an adapter with USB ports!

If you’re ever going overseas, you’ll need an adapter converter for any electronics, probably your iphone/ipad/laptop. I would highly recommend a travel adapter converter that includes some USB charging ports. Most hotels nowadays will have these things, but most airports don’t and probably most airbnbs don’t either.

There are other kinds. The ones you want to avoid are the ones with many parts. I was embarrassed when I was in Singapore and had a travel adapter that didn’t fit! One end was literally made to fit in another and it didn’t fit! This one is one piece, so besides the cords, there’s not much that can break. Additionally, there’s a USB-C port. Many tablets and phones now are exclusively usb-c, so this one works great for that use case!

The adapter/charger I got is the Achoro one. I don’t know if there’s a named brand one of these, but this one has served me well for a few uses. I plug this one into the wall where I get a nightlight builtin and charge my iphone/ipad/watch/laptop overnight at the same time with it. https://usgiftgiant.com/achoro-4-usb-ports-travel-adapter/

For just $20, I would say this is a great deal. I would recommend putting one in the suitcase and one in the backpack just in case – these things can easily be lost and unless you’re in Asia, they’re pretty expensive to buy when you need them immediately.