Remote desktop client shows white screen

To query remote sessions:

qwinsta /server:SERVER-NAME

SESSIONNAME USERNAME ID STATE TYPE DEVICE
services 0 Disc
Administrator 2 Disc
console 3 Conn
rdp-tcp 65536 Listen

To end the session which shows the white screen

logoff /server:SERVER-NAME 2 /v

  • Share/Save/Bookmark

mysqldump mysql database with large innodb tables faster

use “–single-transaction –quick –lock-tables=false” options to omit innodb begins/commits single transaction on any query.

Example:
mysqldump -u USER -p –single-transaction –quick –lock-tables=false DATABASE

  • Share/Save/Bookmark

untar all files in a directory

for i in *.tar.gz; do echo extracting $i; tar xvzf $i ;

  • Share/Save/Bookmark

VirtualBox Fedora 13 install guest additions

Install packages needed

yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
in VirtualBox devices, select install guest additions
sh VBoxLinuxAdditions.run

  • Share/Save/Bookmark

VirtualBox Fedora 13 guest use shared folder

Fedora 13 as guest OS on a Windows 7 host

Add a shared folder in virtualbox’s devices settings.
create a folder “Shared” in fedora
su –c “mount.vboxsf Shared ~/Shared -o rw,exec,uid=1000,gid=1000,dev”

  • Share/Save/Bookmark

Create multiple volumn zip backup with MD5 check

Download and install p7zip:
http://p7zip.sourceforge.net/

Then use 7z
Code:

7z a -v50m test.zip your-big-file-paths

this makes 50 MB volumes called
Code:

test.zip.001 test.zip.002 test.zip.003 test.zip.004

To extract them just run
Code:


7z x test.zip.001

make md5

# md5sum test.zip.* > MD5SUM
# cat MD5SUM
cb16175f4acad02f977f74d5c142879b test.zip.001
33c745ca49ab6e63b727658ec148cf67 test.zip.002
14e6952b632fbb7f4c0731067afdb46c test.zip.003
....

check md5

# md5sum --check MD5SUM

  • Share/Save/Bookmark

SVN make a sub folder to a seperate new repository


svnadmin dump /svn/old_repos > ./repository.dump
svndumpfilter include path/to/docs --drop-empty-revs --renumber-revs --preserve-revprops < ./repository.dump > ./docs_only.dump
svnadmin load /svn/new_repos < ./docs_only.dump

  • Share/Save/Bookmark

Open and edit files from remote server

In my workplace, every developer needs to work on own directory in a shared dev server.

Here is the command I ran to open my directory and edit my files remotely.

1
sshfs username@192.168.0.6:/remote/directory/path /mount/to/your/local/directory/path

* 192.168.0.6 is IP of remote server.

After you ran this, access to /mount/to/your/local/directory/path directory is same as access to remote directory.

Have fun. :)

  • Share/Save/Bookmark

Remove svn directories and files

Deleting all SVN files and directories is a headache if your project contains lots of directories.

Here is a easy way to delete them with one command.

1
find /path/to/your/directory -type d -name .svn -exec rm -rf '{}' +
  • Share/Save/Bookmark

PHP file_get_contents connection timeout

1
2
3
4
5
6
7
8
9
 
$context = stream_context_create(array(
    'http' => array(
        'timeout' => 60   //timeout after 60 seconds
        )
    )
); 
 
$file_content = file_get_contents($source_url,0,$ctx);

for more stream context options, please visit php.net

  • Share/Save/Bookmark