Difference between pages "Package:WPA Supplicant" and "Package:Bash"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
m (Fix pipes with {{!}} instead of nowiki in order to preserve colorization)
 
Line 1: Line 1:
{{Ebuild
{{Ebuild
|Summary=wpa_supplicant is a cross-platform supplicant with support for open, WEP, WPA and WPA2. It handles scanning, connection and automatic reconnect to access points. wpa_supplicant has <code>wpa_cli</code> and <code>wpa_gui</code> frontends and <code>wpa_supplicant</code> daemon.
|Summary=The standard GNU Bourne-again shell.
|CatPkg=net-wireless/wpa_supplicant
|CatPkg=app-shells/bash
|Maintainer=
|Maintainer=
|Homepage=http://hostap.epitest.fi/wpa_supplicant/
}}
}}
This is the ebuild for <tt>bash</tt>, the standard shell for Funtoo Linux systems.


== Configuration ==
'''Bash''' is the GNU Project's ''Bourne Again SHell'', a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command line editing, job control on architectures that support it, csh-like features such as history substitution and brace expansion, and a slew of other features. [http://tiswww.case.edu/php/chet/bash/bashtop.html]
You can configure <code>wpa_supplicant</code> daemon by editing <code>/etc/wpa_supplicant/wpa_supplicant.conf</code>.
{{file|name=/etc/wpa_supplicant/wpa_supplicant.conf|lang=|desc=wpa_supplicant daemon config|body=
# provide control interface for wpa_cli and wpa_gui frontends
ctrl_interface=/run/wpa_supplicant


# allow wpa_cli and wpa_gui to update config
== Learning Bash ==
update_config=1


network={
The following articles, written originally for IBM developerWorks by Daniel Robbins, serve as an excellent introduction to the bash shell:
ssid="SSID"
 
psk="passphrace"
* [[Bash by Example, Part 1]]
}
* [[Bash by Example, Part 2]]
* [[Bash by Example, Part 3]]
 
== Moving on Command Line ==


network={
{|class="table table-striped"
ssid="SSID2"
|| Shortcut || Description
key_mgmt=NONE
|-
}
|| <code>Tab</code> || Autocomplete
}}
|-
|| <code>Ctrl + r</code> || Search as you type from lastlog
|-
|| <code>Ctrl + a</code> || Move to the start of line
|-
|| <code>Ctrl + e</code> || Move to the end of line
|-
|| <code>Ctrl + k</code> || Cut from cursor to the end of line
|-
|| <code>Ctrl + w</code> || Cut from cursor to the previous whitespace
|-
|| <code>Ctrl + c</code> || Clear line
|-
|| <code>Ctrl + l</code> || Clear screen
|-
||<code>Alt + f</code> || Move one word forward
|-
|| <code>Alt + b</code> || Move one word backwards
|-
|| <code>Alt + d</code> || Cut from cursor to the end of word
|-
|| <code>Alt + backspace</code> || Cut from cursor to the start of word


== Daemon ==
|}
Start daemon with [[openrc]].
<console>
###i## /etc/init.d/wpa_supplicant start
</console>
You can also add it to default runlevel.
<console>
###i## rc-update add wpa_supplicant default
</console>


The daemon can work independently or you can use wpa_cli and wpa_gui frontends. You can also alter configs with frontends.
== Bash Completion ==
See [[Package:Bash completion|bash completion page]].


== wpa_cli CLI Frontend ==
== Configuration Files ==
You can start cli frontend by running <code>wpa_cli</code>.
=== ~/.bashrc ===
<console>
<code>~/.bashrc</code> gets loaded on bash startup. You can source files, put aliases, functions and export variables there.
###i## wpa_cli
{{file|name=~/.bashrc|lang=bash|desc=bash runtime configuration|body=
</console>
source /etc/profile.d/bash-completion.sh


=== Scan Access Points ===
export EDITOR="vim"
<console>
>##i## scan
OK
<3>CTRL-EVENT-SCAN-STARTED
<3>CTRL-EVENT-SCAN-RESULTS
>##i## scan_results
bssid / frequency / signal level / flags / ssid
50:32:75:ee:b6:fb      2462    -41    [WPA2-PSK-CCMP][ESS]    AndroidAP
00:3a:98:99:12:f3      2412    -71    [WPA2-EAP-CCMP][ESS]    wEKSOTE
00:3a:98:99:12:f0      2412    -71    [WPA2-EAP-CCMP][ESS]    wULAPPA
00:23:33:a2:7d:14      2462    -85    [WPA2-EAP-CCMP][ESS]    SaitaBYOD
00:3a:98:99:12:f1      2412    -70    [ESS]  saitaOpen
</console>


=== Connect to Access Point ===
alias mv='mv -v'
<console>
alias cp='cp -v'
>##i## add_network
alias rm='rm -v'
0
>##i## set_network 0 ssid "SSID"
>##i## set_network 0 psk "passphrase"
>##i## enable_network 0
<2>CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (reauth) [id=0 id_str=]
</console>


=== Save config ===
alias e='emerge'
<console>
alias eu='emerge -uavDN --with-bdeps=y @world'
>##i## save_config
OK
</console>


== wpa_gui GUI Frontend ==
alias used='cat  ~/.bash_history {{!}} sort {{!}} uniq -c {{!}} sort -n'
<code>wpa_gui</code> is simple gui frontend. You can start it by running <code>wpa_gui</code>.
<console>
###i## wpa_gui
</console>


== Autoconfigure IP with dhcpcd ==
calculator() {
You can use [[Package:dhcpcd]] to autoconfigure ip address.
        echo "$@" {{!}} bc
<console>
}
###i## emerge -av dhcpcd
}}
###i## /etc/init.d/dhcpcd start
</console>


{{EbuildFooter}}
{{EbuildFooter}}

Revision as of 18:05, October 2, 2014

Bash

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

This is the ebuild for bash, the standard shell for Funtoo Linux systems.

Bash is the GNU Project's Bourne Again SHell, a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command line editing, job control on architectures that support it, csh-like features such as history substitution and brace expansion, and a slew of other features. [1]

Learning Bash

The following articles, written originally for IBM developerWorks by Daniel Robbins, serve as an excellent introduction to the bash shell:

Moving on Command Line

Shortcut Description
Tab Autocomplete
Ctrl + r Search as you type from lastlog
Ctrl + a Move to the start of line
Ctrl + e Move to the end of line
Ctrl + k Cut from cursor to the end of line
Ctrl + w Cut from cursor to the previous whitespace
Ctrl + c Clear line
Ctrl + l Clear screen
Alt + f Move one word forward
Alt + b Move one word backwards
Alt + d Cut from cursor to the end of word
Alt + backspace Cut from cursor to the start of word

Bash Completion

See bash completion page.

Configuration Files

~/.bashrc

~/.bashrc gets loaded on bash startup. You can source files, put aliases, functions and export variables there.

   ~/.bashrc (bash source code) - bash runtime configuration
source /etc/profile.d/bash-completion.sh

export EDITOR="vim"

alias mv='mv -v'
alias cp='cp -v'
alias rm='rm -v'

alias e='emerge'
alias eu='emerge -uavDN --with-bdeps=y @world'

alias used='cat  ~/.bash_history | sort | uniq -c | sort -n'

calculator() {
        echo "$@" | bc
}