Python ASYNCIO
Published on
Published on
Published on
Published on
Published on
This is a basic setup to boot Arch Linux over PXE.
Mount the Arch Linux image.
mkdir -p /mnt/archiso
mount -o loop,ro archlinux-2013.02.01-dual.iso /mnt/archiso
Connect your server with your client and setup the server interface for that connection with a static ip address in the /etc/network/interfaces
file.
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
Restart the network interface.
ifdown eth0
ifup eth0
Configure dnsmasq as dhcp- and tftp-server in /etc/dnsmasq.conf
.
dhcp-boot=/mnt/archiso/arch/boot/syslinux/pxelinux.0
dhcp-option-force=209,boot/syslinux/archiso.cfg
dhcp-option-force=210,/mnt/archiso/arch/
enable-tftp
tftp-root=/mnt/archiso
Restart the service.
service dnsmasq restart
Start an http-server inside the Arch Linux mount folder.
python -m SimpleHTTPServer 80
Published on
Published on
This is a description of how to setup a basic system with Arch Linux based on this guide. Infos on the Thinkpad T410 can be found here.
Change keyboard layout:
loadkeys de
Create partitions using gdisk /dev/sda
.
Type n
to create these partitions with the default configurations except the mentioned ones:
boot
+250M
swap
+2G
8200
root
+15G
home
Type p
to confirm and w
to write changes to the disk.
Make filesystems
mkfs -t ext4 /dev/sda1
mkswap /dev/sda2
mkfs -t ext4 /dev/sda3
mkfs -t ext4 /dev/sda4
Mount
swapon /dev/sda2
mount /dev/sda3 /mnt
cd /mnt
mkdir boot home
mount /dev/sda1 boot
mount /dev/sda4 home
Install
pacstrap /mnt base base-devel gdisk
Generate fstab
genfstab -p /mnt >> /mnt/etc/fstab
more /mnt/etc/fstab
Bootloader
pacstrap /mnt syslinux
Configure it inside the new system.
arch-chroot /mnt
bash
Write to /etc/locale.conf
:
LANG="en_US.UTF-8"
Uncomment in /etc/locale.gen
:
en_US.UTF-8 UTF-8
en_US ISO-8859-1
locale-gen
Timezone
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
Set /etc/hostname
Copy bootloader files
cd /boot/syslinux/
cp /usr/lib/syslinux/menu.c32 .
cp /usr/lib/syslinux/vesamenu.c32 .
cp /usr/lib/syslinux/chain.c32 .
cp /usr/lib/syslinux/hdt.c32 .
cp /usr/lib/syslinux/reboot.c32 .
cp /usr/lib/syslinux/poweroff.com .
extlinux --install /boot/syslinux
dd conv=notrunc bs=440 count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda
Altenative:
syslinux-install_update -iam
Setup ramdisk
mkinitcpio -p linux
Set root password
passwd
Exit system
exit
exit
Unmount
umount /mnt/boot
umount /mnt/home
swapoff /dev/sda2
umount /mnt
Set legacy BIOS bootable on partition 1:
sgdisk /dev/sda --attributes=1:set:2
reboot
Configure network
dhcpcd
or for wifi
pacman -S net-tools wireless_tools wpa_supplicant wpa_actiond dialog
wifi-menu <interface>
use netcfg for network profiles
Add a user
useradd -m -g users -s /bin/bash <name>
passwd <name>
Install sudo and make user a sudoer
pacman -S sudo
In /etc/sudoers
add
<name> ALL=(ALL) ALL
Log in
exit
Set default keyborad layout in /etc/vconsole.conf
KEYMAP=de-latin1-nodeadkeys
Enable auto network configuration
sudo systemctl enable dhcpcd.service
Install X
sudo pacman -S xorg-server xorg-xinit xorg-server-utils
Install mesa (for 3d-graphics)
sudo pacman -S mesa
or nvidia driver
sudo pacman -S nvidia
or nvidia-utils-bumblebee
and nvidia-bumblebee
for optimus and start
gpasswd -a <username> bumblebee
exit
systemctl enable bumblebeed
reboot
or for Intel
Virtualbox utils
sudo pacman -S virtualbox-guest-utils
Add to /etc/modules-load.d/virtualbox.conf
vboxguest
vboxsf
vboxvideo
ZSH
sudo pacman -S zsh
chsh -s $(which zsh)
settings in .zshrc
autoload -U compinit promptinit
compinit
promptinit
# This will set the default prompt to the walters theme
prompt walters
xfce
sudo pacman -S xfce4 xfce4-goodies
copy
cp /etc/skel/.xinitrc ~/.xinitrc
add line
exec startxfce4
Published on
Published on
Published on
This is a description of how to setup a basic working system, after installing Ubuntu Minimal.
First install X.org, Xfce to get a graphical interface and wicd to manage your network connections:
sudo aptitude install xorg xfce4 wicd
Then type startx
to run the graphical environment (if this does not work, add exec startxfce4
to your .xinitrc
in your home directory).
conky for system monitoring and HardInfo for hardware informations.
sudo aptitude install xfce4-terminal conky hardinfo
Create user:
sudo adduser <username>
Add user to certain groups:
sudo usermod -aG dialout,cdrom,floppy,audio,video,plugdev,fuse,lpadmin <username>
sudo aptitude update
sudo aptitude safe-upgrade
sudo aptitude full-upgrade
To browser and create windows network share you need samba (pyNeighborhood is a SMB/CIFS browsing utility):
sudo aptitude install smbfs pyneighborhood
Xarchiver for compressed files, VLC for Video Playback, Epdfview for PDFs, Transmission for torrents, Chrome for web-browsing and Flash/Java plugins.
sudo aptitude install xarchiver vlc epdfview transmission chromium-browser flashplugin-nonfree flashplugin-installer chromium-codecs-ffmpeg chromium-codecs-ffmpeg-extra
To compile and install ViewNior:
sudo aptitude install build-essential intltool libgdk-pixbuf2.0-dev libgtk2.0-dev
tar zxvf viewnior-1.3.tar.gz
cd cd viewnior-1.3
./configure
make
sudo make install
Install texlive from the website because the distribution contained in Ubuntu is old.
tar xf Sublime\ Text\ 2\ Build\ 2181\ x64.tar.bz2
./usr/lib
with sudo mv Sublime\ Text\ 2 /usr/lib/
.sudo ln -s /usr/lib/Sublime\ Text\ 2/sublime_text /usr/bin/sublime
.Create a desktop file in /usr/share/applications
using sudo sublime /usr/share/applications/sublime.desktop
containing:
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=sublime
Terminal=false
Icon=/usr/lib/Sublime Text 2/Icon/48x48/sublime_text.png
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n
TargetEnvironment=Unity
defaults.list
using sudo sublime /usr/share/applications/defaults.list
.sudo aptitude install haskell-platform
Published on
Published on
This is a collection of useful tutorials, texts, notes, packages and tools for the Python Programming Language.
pip is a tool for installing and managing Python packages.
easy_install pip
virtualenv is a tool to create isolated Python environments.
pip install virtualenv
virtualenvwrapper is a set of bash functions to keep virtual environments manageable.
pip install virtualenvwrapper
SymPy is a Python library for symbolic mathematics.
Pylint is a python tool that checks if a module satisfies a coding standard.
pip install pylint
Requests: HTTP for Humans
pip install requests
Envoy: Python Subprocesses for Humans
pip install envoy
Twisted is an event-driven networking engine.
pip install twisted
Flask and Bottle are easy to use web framework.
pip install flask
pip install bottle
colorama for cross-platform colored terminal text.
autopep8 automatically formats Python code to conform to the PEP 8 style guide.
Published on
Published on
Published on
Published on
Published on
Published on
Published on
Published on
Published on
Published on
Published on