Thursday, June 20, 2019
Wednesday, April 24, 2019
Hiding menu items of Navigation Drawer of Android to manage dynamic menu display
Navigation Drawer in android development is an important feature that we can implement on demand. In the navigation drawer different types of menu resides. In some case, we may need to load different menu options in the navigation drawer depending on users types. This can be implemented easily by hiding menu items from the already existing drawer.
NavigationView naviView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
hideItem();
}
private void hideItem()
{
naviView = (NavigationView) findViewById(R.id.nav_view);
Menu naviMenu = naviView.getMenu();
naviMenu.findItem(R.id.nav_create).setVisible(false);
}
The above hideItem() function will invisible the item nav_create from the menu of the drawer.
N.B: Menu itmes exist in res->menu->_drawer.xml
Wednesday, February 6, 2019
iptables in hp ux
IPTABLES are not used in hpux , iptables used only in linux.
Using Ipfilter to block connections from an external machine to our HPUX box
Wed, 08/12/2009 - 15:04 — liquid
Hi,
This is a quick introduction to Ipfilter on HP-UX:
First we have to start the daemons and load the DLKM module
in the file /etc/rc.config.d/ipfconf
we set the IPF_START to 1
IPF_START=1
Then we load the kernel module
# /sbin/init.d/ipfboot start
Set 0 now inactive
Set 0 now inactive
0 entries flushed from NAT table
0 entries flushed from NAT list
we can check the kernel module is loaded:
# kcmodule| grep ipf
ipf loaded explicit auto-loadable, unloadable
then we check ipf is working ok:
# ipf -V
ipf: HP IP Filter: v3.5alpha5 (A.11.23.15.01) (376)
Kernel: HP IP Filter: v3.5alpha5 (A.11.23.15.01)
Running: yes <---- font="" ok="">---->
Log Flags: 0 = none set
Default: pass all, Logging: available
Active list: 1
know we can write the firewall rules to our config file:
# vi /etc/opt/ipf/ipf.conf
we are going to use a very easy example, we we block any incoming conections from the server 0189 to our HP-UX box
block in quick on lan0 from 0189 to any
pass in from any to any
using the quick keyword makes the package that matches that rule will be applied inmediatly, no going trough anymore rules.
We load the new config:
#ipf -Fa -f /etc/opt/ipf/ipf.conf
Check if our rules are active:
# ipfstat -io
empty list for ipfilter(out)
block in quick on lan0 from 1.7.2.3/23 to any
pass in from any to any
Now i can't ssh,ping,etc the HPUX_BOX from my pc desktop:
P:\>ping HPUX_BOX
Haciendo ping a HPUX_BOX [1.7.2.23] con 32 bytes de datos:
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
EstadÃsticas de ping para 1.7.2.23 :
Paquetes: enviados = 4, recibidos = 0, perdidos = 4
(100% perdidos),
We can check out the stats and see how the blocked counter increases:
[root@vmfcont:~]# ipfstat | grep -i blocked
input packets: blocked 7 passed 13677 nomatch 1 counted 0 short 0
output packets: blocked 0 passed 570 nomatch 268 counted 0 short 0
If we wan't to flush the rules and delete them from the active ipf:
# ipf -Fa
# ipfstat -io
empty list for ipfilter(out)
empty list for ipfilter(in)
For more info:
http://www.docs.hp.com/en/B9901-90029/index.html
Labels:
HP-UX,
System Admin
Location:
DBBL IT Development Division, Dhaka
Thursday, November 1, 2018
TNS Listener supports no services
For the case Oracle 11g database in linux, I encountered an issue where the database listener was unable to connect to any DB service although the associated database server was started, up and running. No matter For each time I issued lsnrctl start commands, the listener was unable to make tie to the running database service. The listener reported the following message at startup;
.
.
.
.
The listener supports no services
The command completed successfully
To overcome this issue, we are in need to leave the listener started and reboot the 11g database. After 11g DB restart, while issuing the lsnrctl status command and we saw that the services registered successfully with the listener.
Location:
DBBL IT Development Division, Dhaka
Tuesday, August 7, 2018
Subscribe to:
Comments (Atom)
