Mobil Mewah

Salah satu sumber Inspirasi.

Mobil Sport terbaik

Anda pasti bisa memilikinya.

Bermain dengan pesawat

Salah satu ide yang gila, Balapan di udara.

Bermain di angkasa

Apakah ini salah satu Goals dalam hidup anda? anda pasti bisa mencapainya

Thursday 7 April 2022

Mount a Network share from Linux

 Most server are using some sort of NAS or remote storage. The simple path is using SMB or cifs on linux machine to access the network storage.

To enable , you need make sure install cifs tools.

# yum install cifs.tools

Then you will able to mount any NAS storage using SMB protocol.

Some caveat are the version difference implementation on cifs. As recently there are security concern on previous version of SMB especially version 1, now we have until SMB version 3.0 

Usually we want the mount will be available after server reboot, so we need to add it on /etc/fstab

Here are sample for centos 6.6

//192.168.1.215/moview /movies cifs username=movies,password=movies,netdev 0 0

And for centos 7.9 release

//192.168.1.215/moview /movies cifs username=movies,password=movies,vers=2.0,_netdev 0 0

If you need more control on the protocol, can look some options from the documentation 

$ man mount.cifs



Friday 6 August 2021

Receive money in US

Recently i need to able to receive USD money transfer within USA. And why is that? So i can save more on the transfer fee and speed up the transaction. And anyone can do it with the technology nowdays with Web Technology and Mobile.

So i use Transfer Wise for my needs. With them i can open an account and can have a US bank account. So with that, anyone in the USA can transfer me money just like they transfer locally. 

I also can receive ACH transfer with the account, which is usable if you have a brokerage account in the USA. Everyone will have brokerage account in USA for stock investment right, if you follow my path here :).

The step quite easy with few steps and you will get an US account.

1. Register with them

2. Deposit minimum 20US$ via any channel like debit card, credit card, wire transfer, ACH.

3. Post your ID Verification and Selfie photo

4. Wait from their confirmation and you set to go.

Can wait to get Withdrawal from my brokerage account monthly from the Profit generated. yay..

You can get Free fee when you register with this link Wise Transfer Register


Wednesday 26 August 2020

IIS on Windows Server Core

 Windows famous because of the GUI to make everything easier. But when you have  windows server core under your management without any documentation, this will make you wonder, why install windows server Core. Is more secure than windows server ?

We not talk about security now. What we are going to talk here is installation of SSL certificate which will be use by the Webservice.

Quite easy with some command, but the diligence to look for what command should you run is the aha moment.

Here i document my journey and the process to do it.

1. You will need other windows server GUI to be able manage the windows core server with GUI.

2. Install the certificate and the root using windows MMC, put on the trusted root certificate.

3. You have the .pfk certificate format to be installed on IIS. But you cannot do it via remote IIS console. its by design.

4. The way to install the pfk is copy your certificate to the core server, and run this :
    C:/> certutil -importpfk <Path to certificate file>
    If prompt for password, enter it and it will success.

5. The last part, change the binding using remote IIS console. Your new SSL certificate will be show up on the list of certificate.

Some notes, the IIS management service not run on the core server , you can start it by :

C:/> net start WMSVC

In my experience on this, really Microsoft windows try to be like Linux part, but it wont be the same. 

In Linux every config file is accessible by a text editor.

That's all for my experience. Hope help someone. 

And i did it !!!

Wednesday 15 July 2020

Compile Erlang using Kerl with crypto module

When working with erlang, we can use old version to run our erlang app which are not yet upgraded.
This multiple erlang version run like python env if you come from python.

So in erlang we using Kerl which can switch to multiple erlang version at runtime. So here we go.

We are using Debian 10.x buster. Some prerequisite before able to finish are install the dev tools.

# apt-get install build-essential autoconf libncurses5-dev openssl libssl-dev fop xsltproc unixodbc-dev libz-dev

Then get the openssl version supported on your erlang version. Here i use 17.5.x release which require openssl-1.0.xx to compile properly with crypto module.



1 $ git clone git@github.com:openssl/openssl.git --branch OpenSSL_1_0_2-stable
2 $ cd openssl
3 $ mkdir __result
4 $ ./config --prefix="${HOME}/openssl" shared zlib -fPIC
5 $ make depend
6 $ make
7 $ make install INSTALL_PREFIX="/home/me/openssl/__result"


Then we can start the kerl compilation.

Get the kerl 

1 $ curl -0 https://raw.githubusercontent.com/kerl/kerl/master/kerl
2 $ chmod a+x kerl

Make the ssl available for kerl compiler

1 $ export KERL_CONFIGURE_OPTIONS="--with-ssl=/home/me/openssl-OpenSSL_1_0_2-stable/__result/home/me/openssl-OpenSSL_1_0_2-stable/openssl/"

2 $ mkdir .kerl
3 $ kerl build 17.5.3 17.5.3

This should be show which indicate SSL included.







 



Then continue with installation:

$ kerl install 17.5.3 ~/.kerl/17.5.3

To test run erlang.

$ . ~/.kerl/17.5.3/activate
$ erl
> crypto:start().

Should no error if install successfully.

And make that fault tolerant app with 0 downtime.


Thursday 25 June 2020

panic cannot login to linux

Panic ! Thats what occurs when a critical systems you manage cannot login , but the service was running properly.

Recently i do some changes on the /etc/security/limits.conf and it make all lockout. No SSH can be done, but all the service was running properly.

To the rescue, we need to login to the systems and revert back changes, and to do that we need to go into single mode.

We do on Centos 7.x systems which is the grub boot loader is different than the old version.

So how to do it step by step, and no panic. 

  • Reboot your machine and immidiately go to rescue mode.
  • Chose one boot options and press "e" to change the entry
  • Look for below entry :
    linux16 /boot/vmlinuz-3.10.0-123.el7.x86_64 root=UUID=act2884249823928928392 ro  xxxxxx
  • Change the ro to below 
    rw init=/sysroot/bin/sh
  • Then continue the boot, press ctrl+x to do that. No worries, after finish you can reboot and the grub boot loader will be still the old one.
  • once boot to single mode you need to mount the filesystem. do
    # chroot /sysroot/
  • After this step you can revert back any settings you made to restore it to working state.
  • On our side, its /etc/security/limits.conf
  • After finish we can reboot the machine to production mode
    # reboot -f
That was no panic attack anymore if you know what you are doing.

Always make sure you have backup of the OS.
Or better way use Container these days. 


Thursday 11 June 2020

Compiling GoLang application

When using Golang basic setup need to be done to able compile all application based on golang in github.
To do that install golang then set in your home directory.

let say /home/geek/go/

inside the folder create a src folder, and put all the go app you want to compile.

Then remember to set env variable GOPATH.

in ~/.bashrc set :

GOPATH = /home/geek/go

Example you have a killer-app download from github with go source code.
Put it inside /home/geek/go/src/killer-app/

Then do this :

$ cd /home/geek/go/src/killer-app/
$ go get ./...
$ go build

Then there will be a file created from the compile called killer-app 

Then profit.


Sunday 7 June 2020

Stafull and Stateless widget in Flutter

In flutter we have 2 type of widget, Statefull and stateless. Difference are the stateless widget will never changes after it rendered. Meantime statefull widget can be change in the future after the widget rendered.

There are difference on how to use it. Because flutter using inheritance of the widget, we will always override some of the function / properties of the widget. There will be a lot of inheritance method in flutter.

Lets go for the stateless widget first. On the stateless widget, the one we override are the build function.
Below is the example code.

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp (
      title: 'Measures Converter' ,
      home: Scaffold(
        appBar: AppBar(
          title: Text('Measures Converter'),
        ),
        body: Center(
          child: Text('Measures Converter'),
        ),
      ),
    );
  }
}


And for statefull widget, we override the createState method.

import 'package:flutter/material.dart';

void
main() => runApp(MyApp());

class
MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp (
title: 'Measures Converter' ,
home: Scaffold(
appBar: AppBar(
title: Text('Measures Converter'),
),
body: Center(
child: Text('Measures Converter'),
),
),
);
}
}

class MyApp extends StatefulWidget {
@override
MyAppState createState() => MyAppState();


}


Twitter Delicious Facebook Digg Stumbleupon Favorites More