Posts

Showing posts from October, 2019

Using RaisedButton in Flutter apps

Image
RaisedButton is a Material design widget. In this post, I am going to show almost all the use cases you might need to know about RaisedButton. A simple usage of RaisedButton would be: RaisedButton( child: Text("Enabled Button"), onPressed: (){}, ), For a disabled button: RaisedButton( child: Text("Disabled Button"), onPressed: null, ), Now to add colors the raised button: RaisedButton( color: Colors. blue , child: Text("Button with colors", style: TextStyle(color: Colors. white ),), onPressed: (){}, ), Button with round corners: RaisedButton( child: Text("Round corner button"), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(30) ), onPressed: (){}, ), Button with custom height and width: ButtonTheme( height: 60, minWidth: 200, child: RaisedButton( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(30) ), child: Text("Button

Learn to use ss — utility to investigate sockets

Image
In this post, I will be discussing about a utility you will often use. The utility is ‘ss’. According to the man page of ss: ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state informations than other tools. Here, we will go through some of the basic usages of ‘ss’ command, which are as follows: $ ss Bare ‘ss’ command lists the TCP established connections. It shows ton of information. Now let’s list all listening sockets using -l option $ ss -l We have now filtered the listing connections only. We can filter TCP and UDP protocols using -t and -u options respectively. For example, to list all the listening sockets using TCP we use: $ ss -tl In the above command you see the service names like domain, ipp and http, if you want to see the port numbers in use, you can use -n option. The example below will show a list of all listening TCP connections with numeric value for the services: $ ss -tln For

Things one should know about Ransomware

Image
Photo by Michael Geiger on  Unsplash Ransomware is a type of malicious software designed to deny access to a computer system or data until a ransom is paid. They are usually spread through phishing emails, infected websites and malvertising (malicious advertising). One must not forget that though they ransom notice says file will be recovered after the ransom is paid, but it is not guaranteed. The first ransomware appeared  Types of Ransomware: a. Scareware Scareware are the simplest type of ransomware. They are the delusive. They show pop up message telling that malware was detected and asks for ransomware to delete it. If you don’t pay, it keeps on bombarding the message. However these ransomware do no damage to your data. The worst it can go is stop you from running any other program because of the continuous pop ups.  b.Screen Lockers Screen Lockers are the next type of ransomware which displays a screening blocking you to use the system. The lock screen asks for

How to use Arachni for web vulnerability scanner

Image
Disclaimer: This is for educational purpose only. Use it responsibly. There are various tools available for web vulnerability scanning. Here in this post, I am going to show how to use Arachni for web vulnerability scanning. This tool is available for Linux, Mac and Windows as a command line interface and web interface. Here, I will guide you the installation in Linux and Mac. And show command line interface for usage. Download in Linux $ wget https://github.com/Arachni/arachni/releases/download/v1.5.1/arachni-1.5.1-0.5.12-linux-x86_64.tar.gz Download in Mac $ wget https://github.com/Arachni/arachni/releases/download/v1.5.1/arachni-1.5.1-0.5.12-darwin-x86_64.tar.gz You can download by clicking the above links through your browser too. You can use a gui based extractor to extract the files. I will show you the command to use for extraction $ tar xvf arachni-1.5.1–0.5.12-linux-x86_64.tar.gz Now you have extracted the archive file. You can add the extracted directory

Share content through flutter app

Image
Today, in this post, I am going to share how you can share the content of your app using share plugin. It’s pretty easy to get this work. First of all create a flutter project then in your pubspec.yaml file add the following line in dependencies: share: ^0.6.2+3 Then run, $ flutter packages get Now let’s create a button on click of which we will share the content we want to share. To share a plain text, we would simply import the library by placing import 'package:share/share.dart'; at the top of the file and then using the following code in the body section: RaisedButton( child: Text("Share"), onPressed: (){ Share.share("Awesome stuff to share"); }, ) We also might want to add subject while sharing in such a case we use: RaisedButton( child: Text("Share"), onPressed: (){ final RenderBox box = context.findRenderObject(); Share. share ("Main message is this", subject:&qu

Install docker-compose in CentOS

Image
Recently, I installed CentOS 8 for one of our in house development server. The server is used to run various docker images for development purpose. For which we wanted to use docker-compose too.  To install docker-compose run: $ sudo curl -L “ https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose The application is installed in /usr/local/bin/docker-compose. To make it executable run $ sudo chmod +x /usr/local/bin/docker-compose It can be run by typing the full path, but here I will show two options one by creating an alias and another by create a soft link: To create an alias which will work for the user logged in, open your ~/.bashrc file and add the following line alias docker-compose=’/usr/local/bin/docker-compose’ Now, you are ready to go. You can simple run with ‘docker-compose’ The other method is creating alias, to create an alias, you can add it to any of your executable bin fol

How to install jdk7 in ubuntu 18.04

Image
JDK7 has been deprecated however, there are still softwares that depend on it. I came across similar issue today and therefor I had to install jdk7. I will show what you need to do if you want to do the same. Frist download archive file of jdk from https://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html . In my case I am going to download jdk-7u80-linux-x64.tar.gz. Now extract the file with the following command: $ tar xvzf jdk-7u80-linux-x64.tar.gz Move the extracted directrory to /usr/lib/jvm $ sudo mv jdk1.7.0_80 /usr/lib/jvm To make the installed java available for update-alternatives run the following command $ sudo update-alternatives — install “/usr/bin/java” “java” “/opt/jdk/jdk1.7.0_80/bin/java” 1  $sudo update-alternatives — install “/usr/bin/javac” “javac” “/opt/jdk/jdk1.7.0_80/bin/javac” 1  $ sudo update-alternatives — install “/usr/bin/javaws” “javaws” “/opt/jdk/jdk1.7.0_80/bin/javaws” 1 Now that update-alter

How to Add Navigation Drawer to Flutter App

Image
In this post, I am going to show how you can implement Navigation Drawer in your flutter project. To add a drawer, in your build function ad drawer as follows return Scaffold(      appBar: AppBar(         title: Text(widget.title),     ),     drawer: Drawer(         child: ListView(             children: <Widget>[]         ),     ),     body: Container(), ); The first item to the ListView is DrawerHeader . DrawerHeader( child: Text("Header", style: TextStyle(color: Colors. white ),), decoration: BoxDecoration( color: Colors. blue ), ), This is very basic, let’s try to replace DrawerHeader with user details for that we use UserAccountsDrawerHeader : UserAccountsDrawerHeader( accountEmail: Text("john.doe@example.com"), accountName: Text("John Doe"), currentAccountPicture: ClipRRect( borderRadius: BorderRadius.circular(110), child: Image.asset("images/user1.jpg", fit: BoxFit.cover,), ),