linux

Create user with restricted access to own directory

Create a new user with it’s home directory set to the one you need him to have access to (this command must be run under sudo or in root shell): adduser –home /restricted/directory restricted_user This will create an user restricted_user, the directory /restricted/directory and then…

Fedora 20 change IP

[root@drash etc]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE=Ethernet BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME=eth0 UUID=e2647d40-8e94-4c17-a842-1d35d72775b1 ONBOOT=yes DNS1=208.67.220.220 DNS2=208.67.222.222 DNS3=213.46.172.36 HWADDR=00:1C:25:1C:D8:B3 PEERDNS=yes PEERROUTES=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_PRIVACY=no # this server’s IP address IPADDR=“192.168.1.116″ # subnet mask NETMASK=“255.255.255.0″ # default gateway GATEWAY=“192.168.1.1″ [root@drash etc]# systemctl…

Motion service check / stop

[jandra@drash ~]$ ps -ef | grep motionmotion 553 1 2 20:51 ? 00:00:02 /usr/bin/motion -njandra 3536 3312 0 20:53 pts/1 00:00:00 grep –color=auto motion [root@drash ~]# service motion stopRedirecting to /bin/systemctl stop motion.service [root@drash ~]# ps -ef | grep motion

FC20 upgrade, skip broken packages

—> Package vlc-core.i686 0:2.1.4-2.fc21 will be an update –> Processing Dependency: libgcrypt.so.20 for package: vlc-core-2.1.4-2.fc21.i686 –> Processing Dependency: libgcrypt.so.20(GCRYPT_1.6) for package: vlc-core-2.1.4-2.fc21.i686 –> Finished Dependency Resolution Error: Package: vlc-core-2.1.4-2.fc21.i686 (rpmfusion-free-rawhide) Requires: libgcrypt.so.20(GCRYPT_1.6) Error: Package: gstreamer-plugins-ugly-0.10.19-16.fc21.i686 (rpmfusion-free-rawhide) Requires: libcdio.so.15 Error: Package:…

Identify kernel version

[root@drash ~]# uname -a Linux drash 3.11.9-300.fc20.i686+PAE #1 SMP Wed Nov 20 22:37:38 UTC 2013 i686 i686 i386 GNU/Linux   [root@drash 3.11.9-300.fc20.i686+PAE]# rpm -qa|grep kernel kernel-3.11.9-300.fc20.i686 libreport-plugin-kerneloops-2.1.9-1.fc20.i686 kernel-PAE-3.11.8-300.fc20.i686 kernel-devel-3.13.6-200.fc20.i686 kernel-3.12.6-300.fc20.i686 kernel-PAE-3.11.9-300.fc20.i686 kernel-3.13.6-200.fc20.i686 kernel-devel-3.11.9-300.fc20.i686 kernel-devel-3.12.6-300.fc20.i686 kernel-modules-extra-3.11.9-300.fc20.i686 kernel-headers-3.12.6-300.fc20.i686 abrt-addon-kerneloops-2.1.9-1.fc20.i686 kernel-PAE-3.11.7-300.fc20.i686 kernel-PAE-devel-3.13.6-200.fc20.i686 [root@drash…

Create user with assigned DB script

#!/bin/bash echo-n „Enter the MySQL root password: “ read-s rootpw echo-n „Enter database name: “ readdbname echo-n „Enter database username: “ readdbuser echo-n „Enter database user password: “ readdbpw db=“create database $dbname;GRANT ALL PRIVILEGES ON $dbname.* TO $dbuser@localhost IDENTIFIED BY…

HOWTO: Repair a broken Ext4 Superblock

This has happened to me a few times, and it’s not a nice problem to find yourself in. You computer won’t boot, all your filesystem checks tell you you’ve a bad superblock, but you cant seem to find how to…

101 Free Admin Tools

We know administrators love tools that make life easier – especially when they’re free! So here are 101 of them! Any free tools you know of that are missing from this list? Leave us a comment! We know administrators love…

Fedora daemon startup

In more recent Fedora releases, there is a new way to auto-start a service: systemctl enable snmpd You can read more about it at

Cron: /dev/null 2>&1 and >/dev/null

When using crontab in Linux or Unix to schedule cron jobs, the cron daemon will automatically send the output of the each and every cron job to root or email address set by MAILTO variable on the cron job. The…