Rating
+1.13
Votes:
1
avatar

Server Administration  

What If you want to to determine whether is 64bit or 32bit node executable installed?

You can try 3 following options:

1) Run node cli and type there:
require('os').arch()

3) Or type there:
process.arch

3) Or type there:
process.env.PROCESSOR_ARCHITECTURE


One of them will work for sure! (The latest one doesn't work on my Macbook but does on Win10 machine)

install telnet client on windiws 7 using console

IT may be useful when you need telnet.exe on win7 machine and for some reason want install/enable it using .bat files


pkgmgr /iu:"TelnetClient"

Create a task in Windows XP/7 Task Scheduler using batch file

In my current job we needed to automatize some processes by using Windows Task Scheduler; I wrote a batch file, which you may find useful,
especially when you don't have direct/remote access to user's desktop.

The main problem of implementation this task was Windows Vista/7 with its UAC, I had to use powershell to get Admin privileges by popping a window prompt to user directly to accept rather than have the user type the password manually upon the request.


( Read more )

Disable users list in login screen of Ubuntu 9.10

Run the following command in terminal:


sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type Boolean --set /apps/gdm/simple-greeter/disable_user_list True

Wrong keyboard mapping in GNOME when working with VNC/XRDP

To fix the subj issue
add the following lines:


export XKL_XMODMAP_DISABLE=1
gconftool-2 -t bool --set /apps/gnome_settings_daemon/plugins/keyboard/active false


at the top of /etc/X11/Xsession

If you need any help with RDP on Linux, let me know

P.S Tested on Ubuntu 9.10

Change grub2 font-size

I searched and searched for the answer to the following question: «How do I change the font size in grub2?» It seems that no one on the entire Internet knew!

Well, I did a lot of digging into the grub2 documentation and the scripts bundled with Ubuntu and I finally have the answer!

1. Pick a font you want to use for your menu. I recommend a nice easy-to-read monospace font such as DejaVu Sans Mono (it's in the example below).
2. Convert the font to grub2's format using the grub-mkfont command, taking the extra step of setting the font size:

sudo grub-mkfont --output=/boot/grub/DejaVuSansMono.pf2 \
--size=24 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf

3. GRUB_FONT=/boot/grub/DejaVuSansMono.pf2
GRUB_FONT=/boot/grub/DejaVuSansMono.pf2

4.

sudo update-grub



FYI: I believe the "--size=" indicates point size but I'm not entirely sure (the documentation doesn't say). If it is based on the point scale I don't believe it is taking dpi into account since I tried "--size=72" on a 120dpi display and letters were only about half an inch tall (72 points is precisely one inch).

By riskable

Backing up your mysql on linux box per each database


#!/bin/bash
MUSER="root"
MPASS="password"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
BAK="/mnt/backupdir"
GZIP="$(which gzip)"
NOW=$(date +"%d_%m_%Y")
for i in `find $BAK -ctime +22`; do rm $i; done
[ ! -d $BAK ] && mkdir -p $BAK
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
 FILE=$BAK/$db.$NOW.gz
 $MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done


it deletes every 22 days old backups if you want to change life-time,
you can change the value of ctime in the followed line: for i in `find $BAK -ctime +22`; do rm $i; done

Backup your Mysql databases installed on windows with a batch file and task scheduler

If you have mysql running on windows platform for example for development/testing purposes, you are probably encountered the backing up issue
here are small bat file that can help you.

First of all you will need 7-zip for archiving SQL dumps, you can download it and use for free, from here

Then

( More... )