Extract
1 2 3 |
mkdir /tmp/initrd cd /tmp/initrd gunzip -c /boot/initrd.gz | cpio -id |
Recreate
1 2 |
cd /tmp/initrd find . | cpio --create --format='newc' | gzip > /boot/initrd_new.gz |
Modifying an initrd |
Extract
1 2 3 |
mkdir /tmp/initrd cd /tmp/initrd gunzip -c /boot/initrd.gz | cpio -id |
Recreate
1 2 |
cd /tmp/initrd find . | cpio --create --format='newc' | gzip > /boot/initrd_new.gz |
I use NotePad++ on Windows and sometimes it is a little frustrating when UAC gets in the way of my editing some files. I have to manually load NotePad++ as Administrator, and try again.
This INF file will install an extra context menu called “Edit with NotePad++ (elevated)”.
Once downloaded, right click the file and choose Install.
Note: The install script assumes NotePad++ is at “C:\Program Files (x86)\Notepad++\notepad++.exe”. You can adjust the location in the install script by editing the very last line.
1 BINPATH="C:\Program Files (x86)\Notepad++\notepad++.exe"
Download
NotepadppElevated.inf (1.3 KiB, 4,380 hits)
(tested on Windows 7 x64)
Logoff Disconnected Users From Remote Desktop via batch-file |
I would like to log-off some users after they have disconnected. Windows has this feature built-in, you can find it at the user-properties “Sessions” tab.
However I have found this feature to be unreliable. Whether it is set to log-off disconnected users at 1 minute or 5 minutes, during isolated tests it works fine, but when in production it has failed multiple times in the last few months with disconnected sessions lingering for hours before noticed.
I found this command-line code to log-off all disconnected users. It seemed to fit the purpose. It uses “quser” to get the list of logged on users, writes them to a file, finds the ones that are disconnected and uses “rwinsta” to log them off. Pretty neat.
I felt I could improve on it though. I saw it didn’t really need to write to a temporary file, and just use internal variables. I also wanted it to connect to multiple servers and be able to list specific users to be logged off.
This can then be added to an elevated scheduled task that runs every X minutes to check for disconnected users.
This is working for Windows Server 2008 R2 and Windows Server 2012.
Disconnect listed users:
(adjust the list of servers and users)
1 2 3 4 5 6 7 8 9 10 11 12 |
@ECHO off rem Logs off disconnected users listed in "%users%" SETLOCAL SET "users=joe jane geoff" SET "servers=rds1 rds2 rds3" FOR %%s IN (%servers%) DO ( FOR /f "tokens=1,2" %%a IN ('"Quser /server:%%s | findstr Disc"') DO ( FOR %%n IN (%users%) DO ( IF /I %%a==%%n rwinsta /server:%%s %%b ) ) ) |
Disconnect all users:
(adjust the list of servers)
1 2 3 4 5 6 7 8 9 |
@ECHO off rem Logs off all disconnected users SETLOCAL SET "servers=rds1 rds2 rds3" FOR %%s IN (%servers%) DO ( FOR /f "tokens=2" %%a IN ('"Quser /server:%%s | findstr Disc"') DO ( rwinsta /server:%%s %%a ) ) |
Teamspeak 3 – Server Admin Query privilege key |
In order to add a user as “Server Admin Query”, login via telnet as “serveradmin” and get a privilege token with the following command:
1 |
tokenadd tokentype=0 tokenid1=2 tokenid2=0 |
You will need to select which virtualserver the token should be generated with first with use sid=[server id]
.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# telnet 127.0.0.1 10011 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. TS3 Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command. login serveradmin [hidden] error id=0 msg=ok use sid=1 error id=0 msg=ok tokenadd tokentype=0 tokenid1=2 tokenid2=0 token=[hidden] error id=0 msg=ok quit Connection closed by foreign host. |
XoloMiner Linux Install Script |
I’ve written an install script for Xolo’s PrimeCoin Pool Miner XoloMiner on my new favourite coin, PrimeCoin (XPM).
This makes the miner ready to use at beeeeer.org, or any other pool that supports XoloMiner.
This is still a work in progress, but the install script itself is complete. So far it has been created only for Debian Wheezy as this is the distro I have been using.
$ ./xolominer
Usage: ./xolominer {start|stop|restart|force-reload|status|install|uninstall}
This script will do the following:
I made this as I have access to a few Debian machines and wanted to be able to quickly and easily install the miner without having to perform it all manually. I also needed a reason to code some more bash 🙂
I actually have similar scripts for installing cpuminer, cgminer and bfgminer but this script has been tested the most and is worthy of public attention, enjoy 🙂
Updated 2014-05-12
Updated build method
Renamed to XoloMiner
Note: When updating, uninstall old version and copy /etc/primeminer/primeminer.conf to /etc/xolominer/xolominer.conf
Download
xolominer.sh (13.3 KiB, 1,883 hits)
Download (old version)
primeminer.sh (12.3 KiB, 2,092 hits)
Happy mining!
How to use:
wget -q https://nooblet.org/blog/download/xolominer.sh;
chmod +x xolominer.sh;
sudo ./xolominer.sh install;