Skip to main content

Posts

Personal Update

I haven't written a lot lately. It's mostly because I haven't got a lot to say that was important enough for me to spend time and write it out. I think that's probably a mistake. I should probably write more just to practice writing and to be more articulate. So I'm trying out a new schedule where I try to write something out at least once a week. I'm going to think of something to write every week and use the whole week to write bits and pieces of it until I can get round to putting it all together to be published on Wednesday. And since this is the first time I'm doing this and I haven't prepared anything for this week, I figure I'll just try something easy like sharing my own personal updates this year. So it's almost the end of 2019. It has been quite a roller coaster ride for me. Just last year, the Pakatan Harapan formed a new government after the 14th General Election in 2018. Ever since then, well.. life has been pretty much the same. T…
Recent posts

Rendering template from string using thymeleaf in spring

Finally solved a very big problem for me... How do I render a page in spring framework that uses the thymeleaf templating engine? The string most probably will come from the database. After long hours of searching and trying, I've got it.

First I've got a clue from this particular stackoverflow question. But following an example from there got me an error about class not found for ognl.PropertyAccessor. That solution was found here.

So here's how I finally done it...

First thing is to create a service where that service can be used wherever you need it in your spring app.


@Service public class PortalService { private TemplateEngine templateEngine; private final static String TEMPLATE_LOCAL = "US"; private TemplateEngine getTemplateEngine(){ if(null == templateEngine){ templateEngine = new TemplateEngine(); StringTemplateResolver templateResolver = new StringTemplateResolver(); templateResolver.s…

Free https

Does your browser saying that your website is insecure make you sad? But you don't have the funds to buy a certified ssl cert makes you even sadder? Well... fret not because now there is a solution for YOU....

Check out https://letsencrypt.org/

It's free, yes, free as in free teh tarik kind of free...

And from there, you can find the link for the client, certbot... https://certbot.eff.org/

Just choose your web server, your server os... and follow the instructions.. it even detects all the domain name you have configured for your server.. awesome easy...

So.. don't be sad... be secure... let's encrypt...

The new Malaysia

Alhamdullillah.... yesterday (Wednesday - 9/5/2018) was a historic day for Malaysia. Thousands of malaysians went out early in the morning, braving long queues in the hot Malaysian sun, to cast their votes... and in doing so, cast out Barisan Nasional and installed Pakatan Harapan as the ruling party of Malaysia. Barisan Nasional who have been ruling over Malaysia ever since its' independence until yesterday. Today, insyaAllah, Tun Mahathir will be sworn in as the 7th Prime Minister of Malaysia. The man who rules over Malaysia for most of my life as the 4th Prime Minister will once again take over the mantel of power. InsyaAllah to do good and make amends with regards to all the bad things and precedence he has done before. The story arc of him and the champion of the people (Anwar Ibrahim) has been long and worthy of a it's own trilogy. Hopefully now we can finally see its' grand conclusion where the truth is finally revealed, justice is finally served, and the people of …

Firefox magnet links

Done a clean install on my laptop and suddenly firefox doesn't open magnet links anymore. Here's how to enable it again:

1. Open Firefox and type in about:config in the Address Bar and hit Enter. 2. Type in enter handler.expose in the search box at the top of the list. 3. right click - New - Boolean 4. Enter the preference name network.protocol-handler.expose.magnet 5. Set its value to false 6. Click on the magnet link and you should see Firefox’s Launch Application Choose Dialog 7. Select your torrent client.

Got it from here.

1 Wireless Adapter, 2 Wifi Network

Had an interesting problem today where I have to access 2 separate wifi networks at the same time so that I could use 1 to access the internet, and the other to access the local network that has been set up.

Found some guiding light from here. So some network adapters can actually handle themselves like they are more than 1 adapter. The trick is to create a sort of virtual network adapter. Into the terminal, type:
sudo iw dev wlan0 interface add wlan1 type station
Where wlan0 is the current device name of the wireless adapter. wlan1 is the new virtual adapter. You might find that you still can't connect because the mac address of the new adapter would still be the same as the original adapter. Change the mac address by typing:
sudo ip link set dev wlan1 address
After changing the mac address, I had to switch off and on again the network adapter before it actually worked. And by golly it actually works.