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 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();


}


Saturday 6 June 2020

Basic Flutter Scaffolding

Flutter makes the development enjoyable and fast.

Here are some of the template for create a basic layout.

We create an app with App bar and a body.
import 'package:flutter/cupertino.dart';
import
"package:flutter/material.dart";

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

class
MyApp extends StatelessWidget {
@override
Widget build(BuildContext context){
return MaterialApp(
title: 'My Work Timer',
theme: ThemeData(
primarySwatch: Colors.blueGrey,
),
home: Scaffold(
appBar: AppBar(
title: Text('My Killer App'),
),
body: Center(
child:
Text('My Killer APp'),
),
),
);
}
}


Mobile Development with Flutter

Nowdays, mobile development not need to be tricky and hard.

Old timers for mobile dev will use java fro android and object C for ios development, which means 2 code for 2 platform Android and IOS.

Other path was hybrid using web development technique which just load a Web view in the application, so developer can use Web development tools and style to develop mobile app.

Now, we have Google who develop Flutter on top of Dart which will make the Java slogan "code once run on any mobile platform (Android / IOS) but now with happiness.

All in flutter just a widget and tooling all free and available and it also beautifull on the app generated because the template also provided like Material Design or Cupertino for IOS.

My interest on Flutter become increasing and after watching some time on the progress of Flutter. Now as on my writing, Flutter version 2.7.0 is been used on my development tools.

You will have my Flutter blogging on their feature and also this will be my flutter docs on my joourney to flutter.

Hope you enjoy it.

Twitter Delicious Facebook Digg Stumbleupon Favorites More