# Connect to a Wireless Router
# $1 = interface (use ip link)
#!/bin/bash
# Enable the interface
ip link set $1 up
# Find access point names
iw dev $1 scan | grep SSID
# Select SSID and enter password
printf "SSID: "
read SSID
printf "pass: "
read -s PASS
# Connect
TEMPFILE=`mktemp`
wpa_passphrase $SSID $PASS > $TEMPFILE
wpa_supplicant -i $1 -c $TEMPFILE -B
rm $TEMPFILE
dhcpcd $1
Tuesday, July 18, 2017
Wednesday, May 17, 2017
RTAGS Quick Setup
RTAGS is a tool for C/C++ code navigation and completion (primarily for Emacs). Here's how to get it working quickly on Arch:
(require 'rtags)
(require 'company-rtags)
(setq rtags-completions-enabled t)
(eval-after-load 'company
'(add-to-list
'company-backends 'company-rtags))
(setq rtags-autostart-diagnostics t)
(rtags-enable-standard-keybindings)
(define-key c-mode-base-map (kbd "M-.") 'rtags-find-symbol-at-point)
(define-key c-mode-base-map (kbd "M-,") 'rtags-location-stack-back)
You may want to enable automatic starting of rdm:;; autostart rdm when entering c modes
(add-hook 'c-mode-hook 'rtags-start-process-unless-running)
(add-hook 'c++-mode-hook 'rtags-start-process-unless-running)
See also:
https://github.com/Andersbakken/rtags
http://syamajala.github.io/c-ide.html
- Get the tool: git clone https://aur.archlinux.org/packages/rtags-git/ ; cd rtags-git/ ; makepkg -si
- Alternatively run `rtags-install` within emacs.
- Start the server: rdm &
- Index your project: cd project-code-dir/ ; make -nk | rc -c -
(require 'rtags)
(require 'company-rtags)
(setq rtags-completions-enabled t)
(eval-after-load 'company
'(add-to-list
'company-backends 'company-rtags))
(setq rtags-autostart-diagnostics t)
(rtags-enable-standard-keybindings)
(define-key c-mode-base-map (kbd "M-.") 'rtags-find-symbol-at-point)
(define-key c-mode-base-map (kbd "M-,") 'rtags-location-stack-back)
You may want to enable automatic starting of rdm:;; autostart rdm when entering c modes
(add-hook 'c-mode-hook 'rtags-start-process-unless-running)
(add-hook 'c++-mode-hook 'rtags-start-process-unless-running)
See also:
https://github.com/Andersbakken/rtags
http://syamajala.github.io/c-ide.html
Saturday, March 18, 2017
Arch installation checklist (i3 desktop)
During basic setup remember to install base-devel as well as base. After basic setup and first reboot:
- Check network (ping 8.8.8.8). If down, find adapter name using ip link and enable dhcp using systemctl enable dhcpcd@<adapter name>.service
- Add a user: useradd -m -G groupname -s /bin/bash username. Enable sudo for that user by editing /etc/sudoers.
- Install:
xorg-server xorg-apps xorg-xinit [graphics-driver] #xorg stuff
i3 dmenu lxappearance compton # Desktop environment
terminator/urxvt firefox git emacs feh bash-completion #Apps
dialog wpa_supplicant wpa_actiond #wireless - Setup xorg to autostart i3. Add exec i3 to ~/.xinitrc (cp /etc/X11/xinit/xinitrc ~/.xinitrc).
- Setup dot-files for i3, i3status, bash (+aliases), emacs and more (via dotfile repo).
- Update X fonts by running lxappearance.
- Setup AUR applications (e.g. Dropbox)
- For wireless, generate configurations by running wifi-menu and enable automatic connection management: sudo systemctl enablenetctl-auto@<interface>.service where interface is the name the wireless card (use ip link to see it) .
Subscribe to:
Posts (Atom)