Skip to content

Instantly share code, notes, and snippets.

# How to add user into group, and make changes take effect *without logout/login*: the *newgrp* command
#
# Do note that this method will only update the groups, in the current shell session (and its child-processes).
# New shell sessions will not have the groups updated - either use this method to update the groups in each shell
# session, or logout/login to make the group update permanent by default
#
# In short:
# $ sudo adduser user_x my_grp
# $ newgrp my_grp && newgrp
#
@dash17291
dash17291 / 99-try-mount.rules
Created April 27, 2013 09:13
Én Backup szervernek squeeze-t használók, ott úgy oldottam meg, hogy a RACK-es vinyóknak adtam egyforma LABEL-t, és az udev kezeli a mount-ot. Egyedül a lebontást kell kézzel elvégeznem.
ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="scsi", ATTRS{model}=="WDC WD20EARX-00P", SYMLINK+="BACKUP", RUN+="/bin/mount /mnt/backup"
ACTION=="remove", SUBSYSTEM=="block", SUBSYSTEMS=="scsi", ATTRS{model}=="WDC WD20EARX-00P", SYMLINK+="BACKUP", RUN+="/bin/umount -l /mnt/backup", RUN+="/usr/local/bin/stop-disk /dev/%k"
@dash17291
dash17291 / z60_hdparm.rules
Created April 27, 2013 09:12
Én Backup szervernek squeeze-t használók, ott úgy oldottam meg, hogy a RACK-es vinyóknak adtam egyforma LABEL-t, és az udev kezeli a mount-ot. Egyedül a lebontást kell kézzel elvégeznem.
ACTION=="add", SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", RUN+="/etc/init.d/hdparm hotplug"
#!/bin/bash
#place this script to /usr/local/bin/stop-disk
if [ "" = "$1" ]; then
echo "Usage: `basename $0` device"
else
umount -l $1
#extract the SCSI ID numbers from the output of lsscsi:
read -d ] A B C D < <(IFS=':'; echo $(lsscsi | grep $1))
#remove the "[" from begining of A:
A=${A##*[} #quicker version: A=${A:1}
### user1 létrehoz egy fájlt:
user1@teszt:~$ touch enyime
### ha azt szeretnéd, hogy user2 is írhasson a fájlba, de nem akarod a csoportokat vagy az umaskot piszkálni, akkor így is adhatsz jogot:
user1@teszt:~$ setfacl -m u:user2:rw enyime
user1@teszt:~$ getfacl enyime
# file: enyime
# owner: user1
# group: user1
user::rw-
user:user2:rw-
+auto.master
/smb /etc/auto.smb
#!/bin/bash
key="$1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
@dash17291
dash17291 / ebay_never_bussiness_again
Created April 13, 2013 21:22
Blocked ebay sellers.
sales_dsehk
dailyappliance2010
@dash17291
dash17291 / ddns
Created March 8, 2013 15:55 — forked from Elbandi/ddns
KEY=/etc/bind/Kize.domain.hu.+111+11111
SERVER=1.2.3.4
ZONE=domain.hu
HOSTNAME=ize
ddns_setup_set() {
if [ "$interface" != "eth0" ] && [ "$new_ip_address" = "$old_ip_address" ]; then
return
fi
(
@dash17291
dash17291 / gist:4598721
Created January 22, 2013 21:42
lxc config file for the container named "template"
# Template used to create this container: debian
# Checksum of the template script (SHA-1): b7ad0dbfed857c24568c74ebeabd093a498ad251
# /var/lib/lxc/template/config
## Container
lxc.utsname = template
lxc.rootfs = /var/lib/lxc/template/rootfs
lxc.arch = x86_64