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"
#!/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}
@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"
### 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
@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
(
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>DuckDuckGo</os:ShortName>
<os:Description>Search DuckDuckGo</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,AAABAAMAEBAAAAEACABoBQAANgAAACAgAAABAAgAqAgAAJ4FAAAwMAAAAQAIAKgOAABGDgAAKAAAABAAAAAgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUvgAAFMAAABfDAAAYwQAAGscAAB7KAAAgzAAAIcwAACHNAAAizgAAI9AAACTQAAAnzAAAJtMAACnXABktyAAALtgAAC/bAAAx3QAAM+AAADbjAAA34wAAOOQAADzYAAA65wAWPdcAADvoAABG1QC6cg0AAFXdAERS0AAAVd8AAF3cAABp5wAAcOUATGziAAB36AAAeugATHLqAF165ABlg+0A0qRkAACS7wAAlO8AeI7nAIGX6gCVndwAAKX1AACr9gAAr/YAALX4AAC3+QCdrvIAALz6AAC9+QAAv/kAAMD7AADH+wAAyvwAAND9ALHB9QAA0vwA5c68AADT/gAA1P0AANT+AADU/wAA1/8AANj/AADZ/wAA3P8AAN3/AGrV+wAA3/8AAOH/AMrS9ADs3tYA39zmAOHj8AB+6v8A5ur6AKDw/wCq8f8A9fDtAPby7wD38vAA6/D8APfz8QD69O4A8PP8APL0/AD69/IA+/fzAPr39QDd+f8A+/n1APb4/QD7+fgA+/r5AOz8/gD1/P8A+vz/AP7+/QD//v8A////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@dash17291
dash17291 / wheezy.preseed
Last active December 10, 2015 03:28
Debian wheezy preseed file for lxc-create -t debian lxc version 0.9.0.alpha2.
#variables needed: container number, hostname, ip, mac, auto, consoles
#lxc-debconfig lxc-debconfig/preseed-file string /etc/lxc/debconfig/wheezy.preseed
#lxc-debconfig lxc-debconfig/preseed-file select
lxc-debconfig lxc-debconfig/apt-recommends boolean false
lxc-debconfig lxc-debconfig/debconf-frontend select noninteractive
lxc-debconfig lxc-debconfig/debconf-priority select low
#lxc-debconfig lxc-debconfig/late-host-command string
#lxc-debconfig lxc-debconfig/capabilities string mac_admin mac_override sys_admin sys_module
lxc-debconfig lxc-debconfig/mount0/entry string /etc/resolv.conf /vz/lxc/template/rootfs/etc/resolv.conf none bind 0 0
lxc-debconfig lxc-debconfig/mount0/comment string Bind mounting host's resolv.conf to the container.