Translate

Thursday, April 12, 2018

Using custom PATH with sudo command on FreeBSD

.: Custom PATH with sudo in FreeBSD :.

In FreeBSD, the sudo command uses PATH defined by the user profile. This way, the user won't be able to find commands inside /sbin, /usr/sbin, /usr/local/sbin. If you want sudo to behavior more like its Linux version, here is how you can add a custom PATH to be used with sudo:

Add this to /usr/local/etc/sudoers.d/secure_path

Defaults secure_path = "/sbin:\
    /bin:\
    /usr/sbin:\
    /usr/bin:\
    /usr/games:\
    /usr/local/sbin:\
    /usr/local/bin:\
    /root/bin"

I hope this helps! =)
FIN

Wednesday, October 4, 2017

Misbehaved Polkit-Agent-Helper

This post can help you when your KDE Polkit Agent Helper misbehaves.
How would you know if you have this actual problem? That's easy!
If you try to take any action that would ask you for administrative permissions and the password window pops up and then disappears quickly, well, then you could have issues with your polkit-agent-helper.

Quick fix:

sudo chmod +s /usr/lib/policykit-1/polkit-agent-helper-1 

That should be enough for the permission window to work as expected again. :)


I hope this can help you out there!

See you next time! ;)

Wednesday, August 6, 2014

Tips and Tricks:NetBSD :: rc.conf sample file for DHCP and WPA Supplicant

This is just a sample based on my own settings.
Enjoy! :)


#       $NetBSD: rc.conf,v 1.96 2000/10/14 17:01:29 wiz Exp $
#
# see rc.conf(5) for more information.
#
# Use program=YES to enable program, NO to disable it. program_flags are
# passed to the program on the command line.
#

# Load the defaults in from /etc/defaults/rc.conf (if it's readable).
# These can be overridden below.
#
if [ -r /etc/defaults/rc.conf ]; then
        . /etc/defaults/rc.conf
fi

# If this is not set to YES, the system will drop into single-user mode.
#
rc_configured=YES

# Add local overrides below
#
hostname=bit

# This enables dhcp client  for all interfaces
# If you want to restrict or limit configuration, please
# take a look at dhcpcd.conf(5).
#dhcpcd=YES

# This is for stopping lease waiting if AP is out of reach
dhcpcd_flags="-q -b"

# Interfaces to be configured.
#
# Sets the net_interfaces variable to the output of ifconfig(8)
# with the ``-l'' flag and suppresses warnings about interfaces in
# this list that do not have an ifconfig file or variable
#auto_ifconfig=YES

# For each interface xxN, the system first looks for ifconfig
# parameters in the variable ifconfig_xxN, and then in the file
# /etc/ifconfig.xxN.
# Information in either the variable or the file is parsed
# identically, except that, if the variable contains a single
# line with embedded semicolons, the the value is split into
# multiple lines prior to further parsing, treating the semicolon
# as a line separator.
net_interfaces="re0 urtw0"

# This is overridden because we have /etc/ifconfig.xxN files ;-)
#ifconfig_re0=dhcp
#ifconfig_urtw0=dhcp

# This tells how to use wPA Supplicant
wpa_supplicant=YES
wpa_supplicant_flags="-B -i urtw0 -c /etc/wpa_supplicant.conf"

# Services
sshd=YES
ntpdate=YES
wscons=YES

Tuesday, August 5, 2014

Tips and Tricks:NetBSD :: WPA Supplicant configuration

This is just a sample configuration for wpa_supplicant.
You can download it to /etc/wpa_supplicant.conf and ajust to your needs!

enjoy! :)

# This is an example file.

# WPA Supplicant stuff
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

# Network configurations
# network={
#    ssid="AP_NAME"
#
#    # a higher value means a network is more desirable.
#    # By default networks have priority 0.
#    priority=10
#
#    # Technique 0 scans for the
#    # SSID using a broadcast Probe Request frame while 1 uses a
#    # directed Probe Request frame.  Access points that cloak them-
#    # selves by not broadcasting their SSID require technique 1, but
#    # beware that this scheme can cause scanning to take longer to complete
#    scan_ssid=0
#
#    # WPA-PSK (WPA pre-shared key), WPA-EAP (WPA using EAP authentication)
#    # IEEE8021X (IEEE 802.1x using EAP authentication and,
#    # optionally, dynamically generated WEP keys), NONE (plaintext or
#    # static WEP keys).
#    # If not set this defaults to "WPA-PSK WPA-EAP".
#    key_mgmt=WPA-PSK
#
#    psk="network_password"
#
#}

#network={
#    ssid="MYUNPROTECTEDWLAN"
#    scan_ssid=1
#    key_mgmt=NONE
#    priority=100
#}

#network={
#    ssid="MYWEAKLYENCRYPTEDWLAN"
#    key_mgmt=NONE
#    wep_key0="12345"  # or 13 characters, or a hexkey starting with 0x
#    wep_tx_keyidx=0
#}


# home network; allow all valid ciphers
network={
    ssid="home_AP"
    priority=100
    scan_ssid=1
    key_mgmt=WPA-PSK
    psk="123456789"
}

## work network;
#network={
#    ssid="library_AP"
#    priority=1
#    scan_ssid=1
#    key_mgmt=WPA-PSK
#    psk="123456789"
#}

## work network;
#network={
#    ssid="board_ap"
#    priority=2
#    scan_ssid=1
#    key_mgmt=WPA-PSK
#    psk="123456789"
#}
#

Friday, May 30, 2014

Overflow Testing Tools

So you just finished writing your super software, hum!?

Well, could you tell me, for sure, if it's protected against overflows? Really? :)
I think these guys could help you answering that question! Give them a try!  ;-)

apt-get install bfbtester rats pscan flawfinder splint


That was a nice one, don't you think?

FIN!




Wednesday, May 28, 2014

Cool colorized log files!

Hi there!
Want to see your scrambled log files on full colors?
Let's go straight to the point! No time to waste! ;-)

apt-get install ccze
tail -f /var/log/messages | ccze

For additional info, try launching ccze --help and also take a look at /etc/cczerc !

That was quick!

Now, just ACK my FIN!

See ya! :)


Sunday, September 29, 2013

Touchpad Tap Enable with XFCE

This is just a quick record regarding how to enable touch pad tapping with XFCE.
I'm using Debian Wheezy, XFCE4 and a Positivo MODO Black Netbook.

Method I - Init script.
Create a script with the code below and tell your XFCE to run it when it starts up.
Synclient TapButton1=1 LBCornerButton=2 RBCornerButton=3 MaxTapTime=150  SingleTapTimeout=150 MaxDoubleTapTime=150 

Method II - Add your settings to X configs.
Edit the file /usr/share/X11/xorg.conf.d/50-synaptics.conf and make the Touch Pad section look like this:
Section "InputClass"                                                
    Identifier "touchpad catchall"
    Driver "synaptics"
    MatchIsTouchpad "on"
    MatchDevicePath "/dev/input/event*"
    Option "TapButton1" "1"
    Option "RBCornerButton" "3"
EndSection 
 
That's it ;-)