Using nmcli connecting to wireless network

I always use minimal installs on Raspberry pi because they’re quick to download and you can test most of the functionality of the device very quickly, but the downside of minimal images it doesn’t have a GUI to use the nice graphical tools which are useful to quickly connect to a wifi network configuring your network device.

This where nmcli comes in handy to quickly do anything you can do with the GUI.example to connect to a Wifi device:

List your wifi device

# nmcli radio
WIFI-HW WIFI WWAN-HW WWAN
enabled enabled enabled enabled

show device status

# nmcli device
DEVICE TYPE STATE CONNECTION 
wlan0 wifi disconnected -- 
eth0 ethernet unavailable -- 
lo loopback unmanaged --

To actually connect to a wireless Acces point:

# nmcli device wifi rescan
# nmcli device wifi list
# nmcli device wifi connect ssid-name password password

to avoid your password being recorded by bash history add –ask example:

# nmcli -ask device wifi connect ssid-name password

It should be enough to get you connected. you can also use nmcli connection to list all configured connection you have example:

# nmcli c
NAME UUID TYPE DEVICE
ens192 3e4458f1-1343-40ae-8d44-de70304125a8 ethernet ens192

Moving your GPG keys to another machine

It pretty straight forward step, the only thing you need to do is copy the *.gpg files (pubring.gpg;secring.gpg; trustdb.gpg; and trustedkeys.gpg, if it exists) along with gpg.conf from the GnuPG home directory (usually ~/.gnupg or C:\Documents and Settings\YOURUSERNAME\Application Data\gnupg) on the current machine to the new machine.

if you are moving it from linux to windows machine you can skip the gpg.conf files

:cayo: :06:

/bin/rm: Argument list too long.

Have you ever encountered this particular messages? don’t know what to do with it? I used to get this a lot on some of the freeBSD server that I maintain, mostly cause when I try to delete the sendmail queue’s, my sendmail realy like to fill up the /var/spool partition :p so from time to time I have to delete it manually, but the thing is the folder contain to many files when I try to rm -fr * nasty “/bin/rm: Argument list too long.” show up. Well the solution is fairly simple (for me that is) for me just use some shell script magic:

1st I make sure I’m in the /var/spool/mqueue, so we don’t want accidentally delete the / partition don’t we?, trust me I happen to me once good thing I run it on my VMware machine if not I’ totally fsck :p. So back to our folder /var/spool/mqueue that is, I just issued this single line of shell script:

for x in *; do rm -vfr $x; done

and all the thousand files in /var/spool/mqueue is gone! there some other way to delete multiple files here a good example how with a different approach :

find . -name '*' | xargs rm

where “.” is the current directory the command is being run

-EOF

Kambing!

Takala kebosanan melanda maka lahirlah sekor kambing yang tidak dpt di kesan asal usul nyer!

#!#c:\Perl\bin\perl.exe -w
# KAMBING BOT!
use strict;
use IO::Socket;

# maklumat penting! untuk ternakan kambing anda
my $pelayan = “oblivion.ca.us.irchighway.net“;
my $nama_kambing_anda = “kekambing”;
my $spesis = “gurun”;

# kandang kambing anda
my $kandang = “#saiyaman-malay”;

# koneksi ke irc server
my $sock = new IO::Socket::INET(PeerAddr => $pelayan,
PeerPort => 6667,
Proto => ‘tcp’) or
die “kambing betul takleh connect plak\n”;
# membuat koneksi ke pelayan
print $sock “NICK $nama_kambing_anda\r\n”;
print $sock “USER $spesis 8 * :Kambing Ternakan zuan\r\n”;

# baca info dari pelayan tunjuk kambing dah masuk
while (my $input = < $sock>) {
if ($input =~ /004/) {
last;
}
elsif ($input =~ /433/) {
die “kambing telah mampus di baham rimau!.”;
}
}

# masuk ke kandang.
print $sock “JOIN $kandang\r\n”;

while (my $input = < $sock>) {
chop $input;
if ($input =~ /^PING(.*)$/i) {
# main ping pong dengan server kalau tak nanti kene sembelih
print $sock “PONG $1\r\n”;
}
else {
# taik kambing bersepah-sepah
print “$input\n”;
}
}

* [kekambing] (~gurun@18251e65.2f9b2a4a.4e929bd.2fc699fcX): Kambing Ternakan zuan
* [kekambing] #saiyaman-malay
* [kekambing] irc.irchighway.net :The IRCHighWay Network
* [kekambing] End of WHOIS list.

PS: nak curik copy ke ape dengan kod di atas silakan takda sape nak marah lepas ko amik ko cakap ko punya aku curik yg ko pun aku takde nak marah nyer sebab aku pun lupa mane aku dapat coding ni har har har harun!