Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
key="$1"
for P in /bin /sbin /usr/bin /usr/sbin
do
if [ -x $P/smbclient ]
then
SMBCLIENT=$P/smbclient
break
+auto.master
/smb /etc/auto.smb
### 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-
#!/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"
@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"
# 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
#
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<a style="font-size: 20pt; color: red" href="http://www.ingyen-tarhely.eu/">http://www.ingyen-tarhely.eu</a>
</body>
</html>
#!/bin/sh
# Copyright (C) 2012 Michael Gorven <http://michael.gorven.za.net/>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@dash17291
dash17291 / otpdirekt.sh
Created June 13, 2013 19:00
OTPdirekt lekérdezése SMS csak tranzakciohoz kell, belepeshez nem. Egyenleghez meg be sem kell lepni. A bankkártya szám és a telekód elég. Alapértelmezésben az azonosító a kártyaszám utolsó 10 számjegye. A telekód, az alapértelmezetten a számlaszám utolsó 3 számjegye. http://hup.hu/node/120903?comments_per_page=9999
#!/bin/bash
read -p "Telekód: " -s line
echo -en "\nEgyenleg: "
wget -q --no-check-certificate -O - https://www.otpbankdirekt.hu/homebank/do/bankkartyaEgyenlegLekerdezes --post-data="azonosito=IDE_JÖN_AZ_AZONOSÍTÓ&telekod=$line&muvelet=login" | grep -e 'span class="value"' | head -1 | cut -d "<" -f 3 | cut -d ">" -f 2