ifconfig eth0 inet 0.0.0.0
ifconfig eth0 up
brctl addbr br0
brctl addif br0 eth0
dhcpcd br0
otrdiena, 2012. gada 13. novembris
Network Bridge on Slackware
Add following lines to /etc/rc.d/rc.local:
trešdiena, 2012. gada 1. augusts
HDD diagnostics
Speed test:
Bad block test:
smartmontools for smart
GSmartControl - GUI
Documentation for Ubuntu:
https://help.ubuntu.com/community/Smartmontools
# hdparam -tT /dev/sdaBad block test:
# badblocks -sv /dev/sdasmartmontools for smart
GSmartControl - GUI
Documentation for Ubuntu:
https://help.ubuntu.com/community/Smartmontools
ceturtdiena, 2012. gada 29. marts
WebDAV with Apache on Slackware 13.37
Edit httpd.conf, uncomment:
at the end of file add:
Create virtual host in
Create password file:
Restart apache web server:
Include /etc/httpd/extra/httpd-dav.confat the end of file add:
DAVLockDB /var/www/DAVLock.db
DAVMinTimeout 600# touch /var/www/DAVLock.db
# chown apache:apache /var/www/DAVLock.dbCreate virtual host in
/etc/httpd/extra/httpd-vhosts.conf:<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot "/var/www/htdocs"
ServerName example
ServerAlias www.example.com
<Directory "/var/www/htdocs">
Allow from all
</Directory>
# WebDav config part
Alias /webdav /var/www/htdocs
<Location "/webdav">
DAV On
AuthType Basic
AuthName "webdav"
AuthUserFile /var/www/htdocs/passwd.dav
Require valid-user
</Location>
# End of WebDav config
ErrorLog "/var/log/httpd/example.com-error"
CustomLog "/var/log/httpd/example.com-custom" common
</VirtualHost> Create password file:
# htpasswd -c /var/www/htdocs/passwd.dav test
# chown root:apache /var/www/htdocs/passwd.dav
# chmod 640 /var/www/htdocs/passwd.davRestart apache web server:
# /etc/rc.d/rc.httpd restart
pirmdiena, 2012. gada 30. janvāris
Tor exit relay on linux
We will run tor as a regular non-root user on slackware 13.37.
First download and install libevent:
Download tor source code and install:
Create configuration files:
Edit torrc:
Test run:
Edit and set up control script located in source directory:
Edit tor.sh:
Options:
Your are done!
*Running tor as root is not recommended.
--
*http://www.linux-tutorial.net/a847
First download and install libevent:
tar -xvzf libevent-2xxx
cd libevent-2xxx
./configure
make
make installDownload tor source code and install:
tar -xvzf tor-0xxx
cd tor-0xxx
./configur --with-libevent-dir=/usr/local/lib
make
make installCreate configuration files:
cd /usr/local/etc/tor
cp torrc.sample torrc
mkdir /var/log/tor
touch /var/log/tor/notices.log
touch /var/log/tor/debug.log
mkdir /var/run/tor
touch /var/run/tor/tor.pid
mkdir /var/lib/tor
chown -R user:users /var/log/tor
chown -R user:users /var/run/tor
chown -R user:users /var/lib/torEdit torrc:
SocksPort 9050
DirPort 9030
SocksListenAddress 127.0.0.1
Log notice file /var/log/tor/notices.log
# Log debug file /var/log/tor/debug.log
DataDirectory /var/lib/tor
Nickname mynickname
ContactInfo your name <mail AT mail dot com>
ORPort 9001 # 443
RelayBandwidthBurst 100 KB # 800Kbps
RelayBandwidthRate 200 KB # 1600KbpsTest run:
/usr/local/bin/tor -f /usr/local/etc/tor/torrcEdit and set up control script located in source directory:
vim tor-0xxx/contrib/torctl
TORBIN="/usr/local/bin/$EXEC"
TORCONF="/usr/local/etc/tor/torrc"
PIDFILE="/var/run/tor/tor.pid"
LOGFILE="/var/log/tor/tor.log"
TORDATA="/var/lib/tor"
TORUSER=usercp torctl /usr/local/bin/scripts/
chmod +x /usr/local/bin/scripts/torctlEdit tor.sh:
DAEMON=/usr/local/bin/tor
TORCTL=/usr/local/bin/scripts/torctl
#TORUSER=_tor
#export TORUSERcp tor.sh /etc/rc.d/init.d/tor.sh
chmod +x /etc/rc.d/init.d/tor.shOptions:
start | stop | restart | reload | status Your are done!
/etc/rc.d/init.d/tor.sh start*Running tor as root is not recommended.
--
*http://www.linux-tutorial.net/a847
otrdiena, 2012. gada 24. janvāris
Chrooted SFTP user with disabled shell access
Open /etc/sshd/sshd.conf and enable if disabled:
Add following lines at the end:
Subsystem sftp internal-sftpAdd following lines at the end:
Match group sftponly # or Match user someuser
ChrootDirectory /home/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
pirmdiena, 2012. gada 9. janvāris
openssl encrypt and decrypt files
encrypt:
decrypt:
openssl des3 -salt -in file.txt -out file.des3 -pass pass:mypassdecrypt:
openssl des3 -d -salt -in file.des3 -out file.txt -pass pass:mypass
otrdiena, 2011. gada 22. novembris
Ubuntu 11.10 kiosk mode with Opera
Install xscreensaver:
Install flashplugin:
* I prefer vim for text editing (you can use/download your favourite text editor):
Go to www.opera.com, choose debian package for Ubuntu,
Install it:
Create kiosk user, set random password, set automatic login.
Log in kiosk user, run
Answer with yes/ok
I prefer disable screen saver
Open opera web browser, choose preferences
startup start with home page, enter home page
Uncheck Enable Password manager
History adresses 0, uncheck remember content on visited pages
Right click on search bar Customize > Remove from toolbar (important for security reasons)
Enable main bar
Right click and remove Open, Save, Print buttons same way.
You may leave Find and Home button, but I removed them all to leave more space for web-page on screen.
In about:config disable "Show crash log upload dialogue" and "Show problem dialogue"
Opera > Exit
Log in as admin user.
* Edit your opera window size (--geometry 1280x1024+0+0)
Add this line, to disable guest account:
* For remote access you can install ssh server
* For security reasons you can install ubuntu firewall
Alt+F2 gufw, enable firewall, disable incoming trafic, open 22. tcp port for ssh.
* When something goes wrong or you just want to login in regular unity session, you need to edit /etc/lightdm/lightdm.conf, change back
save and reboot
You can do this from
1) SSH or
2) Reboot machine, hold shift while grub loading, choose recovery mode, root console, enter password.
* You may wish change opera settings folder to read-only, but I found it not necessary to do.
--
http://www.instructables.com/id/Setting-Up-Ubuntu-as-a-Kiosk-Web-Appliance/
http://www.opera.com/support/mastering/kiosk/
sudo apt-get install xscreensav* -yInstall flashplugin:
sudo apt-get isntall ubuntu-restricted-extras -y* I prefer vim for text editing (you can use/download your favourite text editor):
sudo apt-get install vim -yGo to www.opera.com, choose debian package for Ubuntu,
Install it:
sudo dpkg -i opera*.debCreate kiosk user, set random password, set automatic login.
Log in kiosk user, run
xscreensaver-demoAnswer with yes/ok
I prefer disable screen saver
Open opera web browser, choose preferences
startup start with home page, enter home page
Uncheck Enable Password manager
History adresses 0, uncheck remember content on visited pages
Right click on search bar Customize > Remove from toolbar (important for security reasons)
Enable main bar
Right click and remove Open, Save, Print buttons same way.
You may leave Find and Home button, but I removed them all to leave more space for web-page on screen.
In about:config disable "Show crash log upload dialogue" and "Show problem dialogue"
Opera > Exit
Log in as admin user.
sudo vim /usr/share/xsessions/kiosk.desktop[Desktop Entry]
Encoding=UTF-8
Name=kiosk
Comment=Opera Kiosk Mode
Exec=/usr/share/xsessions/opera.sh
Type=Applicationsudo vim /usr/share/xsessions/opera.sh#!/bin/bash
xscreensaver -nosplash &
#while true; do opera; sleep 5s; done
while true; do opera --k --kioskbuttons --kioskresetstation --nochangebuttons --nochangefullscreen --nocontextmenu --nodownload --nokeys --nomail --nomaillinks --nomenu --nominmaxbuttons --noprint --nosave --nosplash --geometry 1280x1024+0+0; sleep 5s; done* Edit your opera window size (--geometry 1280x1024+0+0)
sudo chmod 755 /usr/share/xsessions/opera.shsudo vim /etc/lightdm/lightdm.confuser-session=kioskAdd this line, to disable guest account:
allow-guest=false* For remote access you can install ssh server
sudo apt-get install openssh-server* For security reasons you can install ubuntu firewall
sudo apt-get install gufwAlt+F2 gufw, enable firewall, disable incoming trafic, open 22. tcp port for ssh.
sudo passwd rootsucrontab -e
0 1 * * * /sbin/rebootsudo reboot* When something goes wrong or you just want to login in regular unity session, you need to edit /etc/lightdm/lightdm.conf, change back
user-session=ubuntusave and reboot
You can do this from
1) SSH or
2) Reboot machine, hold shift while grub loading, choose recovery mode, root console, enter password.
* You may wish change opera settings folder to read-only, but I found it not necessary to do.
--
http://www.instructables.com/id/Setting-Up-Ubuntu-as-a-Kiosk-Web-Appliance/
http://www.opera.com/support/mastering/kiosk/
Abonēt:
Ziņas (Atom)