Wednesday, 18 November 2015

Issues following Windows 10 upgrade (from windows 7)

Upgrade itself went smoothly, but system was pretty much impossible to operate, as every several seconds my screen flickered.

I have found this issue described by various users as:

Top window losing focus

or

Taskbar refreshing every 5 seconds

or

explorer.exe crashing and restarting / explorer.exe crash loop

Essentially extremely annoying behaviour not only not allowing to write anything without having to click inside the window, but also closing some Windows 10 dialogues.

I went through a long investigation process and found out that for Dell Laptops migrating into Win10, you may end up with some legacy drivers left there (in my case without even front-end to uninstall them) which will still be called and will crash explorer.exe causing massive CPU usage spikes and in effect the issue described above.

The offending driver was: C:\WINDOWS\System32\IDTNC64.cpl which apparently is a sound driver.

I would suggest that prior to any changes you first check if  your system is safe and sound otherwise by running:

sfc /scannow

in console in Administrator mode (elevated mode), which you can do like this:

Hit CTRL+Shift+Esc to open Task Manager

Select File -> Create new task (from top menu)

and then:



And press OK.

Enter the
sfc /scannow
and wait....

If everything is fine, then close console window and proceed to Even Viewer:

Press Windows+R to open the Run dialog, enter eventvwr and hit OK

There under summary of Administrative events in Errors part look for the one with the highest number of errors.



You should find the reason of your problems there, by double clicking the line, choosing Administrative Events from the menu on the left and going through the list looking for Level: Error, Source: Application Error

For me it was:

Faulting application name: explorer.exe, version: 10.0.10586.0, time stamp: 0x5632d4c0
Faulting module name: IDTNC64.cpl, version: 1.0.6454.0, time stamp: 0x5110e190
Exception code: 0xc0000005
Fault offset: 0x0000000000001154
Faulting process id: 0x1170
Faulting application start time: 0x01d12064eb4ed614
Faulting application path: C:\WINDOWS\explorer.exe
Faulting module path: C:\WINDOWS\system32\IDTNC64.cpl
Report Id: f5071629-6146-48da-9c51-e31661b1596b
Faulting package full name:
Faulting package-relative application ID:

You SHOULD try and uninstall the driver normally first.

I couldn't so the only option for me is to (again in administrator mode) rename the file to IDTNC64.cpl.trash

And wait for an updated version of the driver from Dell.

New Old Dell

Since my old Dell served me so well for so many years, even though it was bought as an old box then I've decided to do exactly the same again, and look for a toy that'll have the best possible specs while not killing my pocket.

So for really moderate £220 I've acquired a refurbished Dell Latitude E6220.

So again I have a laptop that fits nicely in my bag with 12.5” HD LED display, sturdy built and with 2.8GHz i7 processor, and 8GB memory it will last me some time still :)

It shipped with windows 7 Pro, which upon receiving the option I have upgraded to 10 (meeting some resistance), and adding VirtualBox with CrunBang's successor: BunsenLabs Hydrogen.




Tuesday, 3 November 2015

on timeouts

I have a webpage (really a script in php) which is munching a lot of data and spits a nice report as a web-page.
Don't ask. It had to be done this way.

That data comes from a very slow source, so the script had to have all sorts of timeouts taken down:

set_time_limit($seconds); 

being the first one. Setting seconds to 0 turns off limits. Use with caution!

Make sure that  this actually will remove execution limit.
Usual setup for php is execution time of the scripts limited to 30 seconds.
If displaying

bool set_time_limit (0);
ini_get('max_execution_time');

What you get isn't 0, then you need to look into changing the php.ini file.
The easiest way to find the location of your php.ini file (if you have access to the console) is running in the command line:

> php --ini

if you don't have access to the shell, then you can always script it by displaying configuration information via:

phpinfo();

Now that you know where to look, locate max_execution_time in it and change to whatever you want it to be. It understands the numbers as seconds. I discourage setting 0 (which will turn it off).

If you can't change your php.ini you might want to create a .htaccess with the following line:

php_value max_execution_time 200

For my needs however I am using wget to actually save the contents of the website to my disk.

That's yet another timeout to take care of. Otherwise wget will timeout, and my script is going to run for minimum 4 hours.

To remove the timeout from wget you need to run it with this parameter timeout set to 0:

> wget --timeout=0


Wednesday, 27 May 2015

Helpful command-line tips for Linux users part 7: displaying files - cat

list of all commands
explanation of the convention:
[] : values in square brackets are optional

cat BASIC USAGE 
cat [OPTION] [FILE]...- concatenate FILE(s) and print on the standard outputs, with no FILE, or when FILE is -, read standard input.
interesting options:
  -A     use ^ and M- notation, except for LFD and TAB, display TAB characters as ^I
  -b     number nonblank output lines
  -E     display $ at end of each line
  -n     number all output lines
  -s     never more than one single blank line

Standard output in most cases is the monitor, and standard input is keyboard, so when using cat without any parameters, what will happen is that you will be displaying on your screen immediately (after pressing ENTER) whatever you type.
This is sometimes useful for scripting purposes.

cat is not a very nice command when it comes to memory usage, so when you cat a large file carelessly, press Ctrl+S to stop displaying immediately. Then press Ctrl+C to stop the cat process.

Normal use of cat will be most often something like this:
> cat /etc/hosts
which will display the contents of the hosts file (if you have sufficient rights to see that file of course).

But mostly you will use cat with other commands such as this:
Split Files into 1024 Megabyte chunks, and then merge parts back into single file (with cat)
> split -b 1024m filename
> cat xa* > filename

Wednesday, 4 March 2015

Helpful command-line tips for Linux users part 6: working with directories - rmdir

list of all commands
explanation of the convention:
[] : values in square brackets are optional

rmdir BASIC USAGE 
rmdir [OPTION] DIRECTORY- remove empty directory/directories

for example this will remove a directory fps from /home/ishtar/games if it is empty
> cd /home/ishtar/games
> rmdir fps
this will do exactly the same, but when you're in a different dir, but it has to be empty, otherwise you will see this.
> cd /
> rmdir /home/ishtar/games
rmdir: failed to remove ‘/home/ishtar/games/’: Directory not empty
Removing many empty directories in one go (two ways):
> cd /home/ishtar/games
~/games > ls
mmos puzzle rpg strategy
~/games > rmdir mmos puzzle
rmdir: failed to remove ‘mmos’: Directory not empty
~/games > ls
mmos  rpg  strategy
As you can see the empty directory has been deleted, but the one which had some content wasn't.
> cd /home/ishtar/games
~/games > rmdir mmos/screenshots/2015/wow/ mmos/screenshots/2015/ mmos/screenshots/ mmos/
~/games > ls 
rpg  strategy
This will only work if all those directories are empty so to remove them nested that way you will either have to go with the last method above, or to save time use option -p:
~/games > rmdir -p mmos/screenshots/2015/wow
~/games > ls
rpg strategy
This is a safe option, because it deletes only directories which are empty.

Tuesday, 3 March 2015

Helpful command-line tips for Linux users part 5: working with directories - mkdir

list of all commands
explanation of the convention:
[] : values in square brackets are optional

mkdir BASIC USAGE 
mkdir [OPTION] DIRECTORY- make a new DIRECTORY

for example this will create a directory games in /home/ishtar/
> cd /home/ishtar
> mkdir games
this will do exactly the same, but when you're in a different dir.
> cd /
> mkdir /home/ishtar/games
Creating many directories in one go:
> cd /home/ishtar/games
~/games > ls
~/games >
~/games > mkdir mmos puzzle rpg strategy fps
~/games > ls 
fps  mmos  puzzle  rpg  strategy
As you can see this creates only one level of directories, but if you want to create a whole tree then that's possible as well with -p option:
~/games > mkdir -p mmos/screenshots/2015/wow
~/games > ls -R mmos/
mmos/:
screenshots

mmos/screenshots:
2015

mmos/screenshots/2015:
wow

mmos/screenshots/2015/wow:
as you can see if a directory exists (mmos) it will not get created, and no error will show up, the other directories are created.

Wednesday, 25 February 2015

World of Warcraft Patch 6.1 - New Patch new problem

Again. After update my WoW stopped running. This time there was no WoW-64 to disable, nor libraries to turn off.

When starting WoW without the Launcher like here what I got was an error window telling me:


This application has encountered a critical error:

ERROR #134 (0x85100086) Fatal Condition

Unable to open DBFilesClient\SoundEntriesFallbacks.dbc:

What needs doing is making sure you have actually upgraded the game.
So get into your installation directory and run Launcher

> cd /home/ishtar/.wine/drive_c/Program\ Files\ \(x86\)/World\ of\ Warcraft
> wine World\ of\ Warcraft\ Launcher.exe

And wait for the update to actually happen. If there is no update to be done it may mean your installation is so broken it's best to clean it and let the launcher repair it.
So again go to the installation directory, delete the Cache dir and start the launcher again.

Tuesday, 24 February 2015

Helpful command-line tips for Linux users part 4: working with directories - pwd (and a bit about symlinks)

list of all commands
explanation of the convention:
[] : values in square brackets are optional

pwd BASIC USAGE 
pwd [option] - Print the full filename of the current working directory

This is a very simple command with only two usage options available in linux (there may sometimes be more options, but in general there are only to display version and help info):

-L     use PWD from environment, even if it contains symlinks
-P     avoid all symlinks

so since there's not much to write about this command I'll explain the idea of symlinks in linux. For the purpose of this post I'll talk about soft links only, hardlinks are behaving the same with pwd.

symlink stands for symbolic link and is a mechanism allowing system or user to create a shortcut/pointer or, to describe it in layman terms, a description for the system to follow in order to navigate to another file or directory in another location.
This is usually done to shorten the access link, for example on many systems, the access to /var/www/html/ is linked as /public_html/.

This can only be done by a system administrator and the way to create a symlink /some_app which will actually be just a shortcut for /usr/sbin/some_dir/some_other/some_application is:
cd /
sudo ln -s  /usr/sbin/some_dir/some_application /some_app
now if you display contents for the / directory (ls -l), you will get:
lrwxrwxrwx 1 root    root    18 Feb 24 16:07 /some_app -> /usr/sbin/some_dir/some_application
So much easier to execute /some_app than to look for it in its obscure directory :)
Of course /usr/sbin/some_dir/some_application has to exist, otherwise you will see the same but the /some_app -> /usr/sbin/some_dir/some_application will be marked with red or the colour your system uses to show an error.

Another common use is when there are many users on a server, they all have website content in their home directories, and administrator links the web content directory /var/www/ to them in order for the apache server to be able to serve them as actual webpages.
For example:

User ishtar has a home directory /home/ishtar and in it her webpage directory: /home/ishtar/my_site

Admin will them create a link to it:
ln -s  /home/ishtar/my_site /var/www/ishtar
And this may be shown by apache as under url: http://someserver.com/~ishtar

So now if you enter /var/www/ishtar (symbolic link) and issue pwd with the options above you will get:
> cd /var/www/ishtar
> pwd
/var/www/ishtar
> pwd -L
/var/www/ishtar
> pwd -P
/home/ishtar/my_site
As you can see the default use of pwd (without options) is is pwd -L.

Helpful command-line tips for Linux users part 3: working with directories - ls

list of all commands
explanation of the convention:
[] : values in square brackets are optional
... : means more elements of that type can be used

ls BASIC USAGE 
ls [option] ... [file] ... - list information about normal [file]s, by default if no options given, you are looking for the file in current directory and sort alphabetically.
for example this will display all files in directory /home/ishtar:
ls /home/ishtar
will show:
bin
Which means that in my home directory I only have one normal (not hidden) directory and no normal files. But really there's more there. For the rest of this entry I am assuming I am in directory /home/isthar so I don't need to specify it next time.

Usually you would like to use several basic options for ls command. And there are more, but the most useful I find are those:

list all files but . and .. (these are in all directories and are used by the system, not much use to normal user).
ls -A
and now suddenly my home directory shows:
.bash_history  bin     .fonts    .mozilla  .vimrc
.bashrc        .emacs  .inputrc  .profile
bold=directory
.name_of_the_file=hidden file

List files in long format
ls -l
will display:
total 4
drwxr-xr-x 2 ishtar users 4096 Feb 17  2014 bin
you see here 7 columns, these are:
drwxr-xr-x file type (here d for directory) and permissions for group (3 letters following d) user (next three letters) and everyone else (last three letters) (w=write, x=execute, r=read, -=no rights)
2 number of hard links
ishtar owner name
users group name
4096 size in bytes
Feb 17 2014 timestamp
bin file/directory/link name
The first line that command produces is total 4 and it is showing you the number of 1kB blocks used by the files in the directory, non-recursively.

List files in long format, but do not list owner
ls -g

When listing files in long format, do not list group
ls -G

Sort by file size
ls -S

Sort by modification time
ls -t

Reverse sort order
ls -r

List one file per line
ls -1

Print sizes in human readable format (e.g., 1K 234M 2G), only makes sense if sizes are displayed, so for long formats only -l, -g and -G
ls -h

Do not sort; list entries in directory order. In combination with one_per_line format '-1', it will show files immediately and it has no memory limitations. Very useful if you're listing very large directories!
ls -U

You can use several options at the same time by combining them into a list starting with -, just like this:
ls -GgAh

This will show you long format list of files with no group and no ., .. directories and with sizes in human readable format:
-rw------- 1   53 Nov  7 13:13 .bash_history
-rw-r--r-- 1 1.2K Feb 17  2014 .bashrc
drwxr-xr-x 2 4.0K Feb 17  2014 bin
-rw-r--r-- 1 1.6K Feb 17  2014 .emacs
drwxr-xr-x 2 4.0K Feb 17  2014 .fonts
-rw-r--r-- 1  861 Feb 17  2014 .inputrc
drwxr-xr-x 2 4.0K Feb 17  2014 .mozilla
-rw-r--r-- 1 1.1K Feb 17  2014 .profile
-rw-r--r-- 1  849 Feb 17  2014 .vimrc


I usually create several aliases in my .bashrc file to speed up traversing through files using the following:
alias la='ls -A'
alias ll='ls -lA'
alias lbig='ll -Sh'
alias lnew='ll -th'
to create lbig command to find the biggest files, and lnew to find the newest ones. As you can see it is simple to combine aliases and options too, so in my system this:
lnew -rG
will display files ordered from the oldest to the newest and will not show me file owner group.

Tuesday, 17 February 2015

Helpful command-line tips for Linux users part 2: working with directories - cd

list of all commands
explanation of the convention:
[] : values in square brackets are optional
| : pipe means OR

cd BASIC USAGE 
cd [-L|-P] [directory] - change your current directory to [directory]
for example this will take you to directory var:
cd /var

USEFUL USES

go to your home directory:
cd

To go back to the previous working directory:
cd -

Go one directory up in the hierarchy:
cd ..

Script the above to do more by adding this to .bashrc:
function cd () {
  local -ri n=${#*};
  if [ $n -eq 0 -o -d "${!n}" -o "${!n}" == "-" ]; then
    builtin cd "$@";
  else
    local e="s:\.\.\.:../..:g";
    builtin cd "${@:1:$n-1}" $(sed -e$e -e$e -e$e <<< "${!n}");
  fi
}
Now cd.. takes you to parent dir, cd ... takes you two up, cd .... 3 up and so on

Sunday, 15 February 2015

Selling remains...

Since my LAtitude X1 has died I no longer have any need for this little tool:

Dell D/Bay External-Media Module Model:PD01S



Compatible Formats
Read: DVD-ROM, DVD-R, DVD-RW, DVD+RW, CD-R/RW, CD-ROM Mode 1, 2, CD-DA, CD-I/FMV, CD-XA, Mixed Mode, CD-Exra, CD-Audio, CD-Plus, CD-Text, Photo-CD, Video CD
Write: CD-R/RW

Product Features
  • Dell Laptop Notebook D / Bay External Powered USB Media Drive Bay Housing
  • This Bay housing uses D series Optical Drives. DP/N: H7531 or compatible
  • Connects to D Port and D Docking Stations. and the following computers
  • Compatible Dell Laptops: Inspiron 300M, Inspiron 9100, Inspiron XPS, Latitude D400 D410 D420 X300 D800 X1

Wednesday, 11 February 2015

Helpful command-line tips for Linux users part 1.

Lets start with a list of VERY useful commands every linux user should know. I will be explaining all of them and giving some nice tips on useful usage in following posts.

working with directories

cd - change directory
ls - list directory contents
pwd - print current working directory
mkdir - make directories
rmdir - remove empty directories

displaying files

cat - print file contents
less & more - print text (file contents) page by page. less is more versatile in many cases because it allows jumping back and forward through the  text and doesn't need to read in the whole document before displaying it, but more has some good uses too
tail - output the last part of files

creating/deleting/changing files and directories

cp - copy files and directories
mv - move (rename) files
rm - remove files or directories
chmod - change file access permissions
chown - change file owner and/or group
touch - change file timestamps (or create an empty file)
dd - convert and copy a file
tar, bzip2, unzip, gzip and many more - compression / decompression tools

displaying files and directories information

lsof - list opened files
find - search for files in a directory hierarchy
stat - display file or file system status
du - estimate file space usage

working with processes

ps - display snapshot of current processes
top - display and update information about CPU processes
kill - by default kill process of a given pid
bg - resume suspended job in the background, While running a command (job) you can pause/suspend it with ctrl-z and kill it with ctrl-c
fg - Resume suspended job in the foreground, and make it the current job

text operations

echo - display a line of text
history - display the command history
grep - print lines matching a pattern
sort - sort lines of text files
diff - find differences between two files or directories' contents
vi or vim - text editor
sed - powerful stream editor (input is file or command-line)

network tools

netstat - print network information
ping - send ICMP ECHO_REQUEST to network hosts (pretty much translates to - check if the host will respond and how quickly)
traceroute - print the route packets trace to network host
wget - non-interactive network downloader
ssh - OpenSSH SSH client
telnet - user interface to the TELNET protocol
ftp - Internet file transfer program
scp - secure copy (remote file copy program)
curl - a tool to transfer data from or to a server

executing commands

sudo - execute a command as another user (mostly as root) alias - display aliases or create an alias for a command
watch - execute a program periodically and print output
cron - daemon to execute scheduled commands

system information

uname - print system information
crontab - print crontab entry for a specific user
free - display the free, used, swap memory available in the system
df - print the file system disk space usage
date - print or set the system date and time
dmesg - program to print out bootup messages

other

clear - clear the terminal screen
passwd - update user's password
mount - mount a file system
lsmod - program to show the status of modules in the Linux Kernel
insmod - simple program to insert a module into the Linux Kernel
rmmod - simple program to remove a module from the Linux Kernel

To get information about any command

man - display the on-line manual pages
whatis - usually a single line description of command
which - tells you what is the actuall path of the command
-h/--help - diplay help information of a command/program

RiP my faithful friend

So the day has come. My Latitude X1 has died. I thought it was the disk, then the memory, but it turned out to be the motherboard. Done and dusted. I thought about reviving it, but frankly it had served me for much longer any other electronic device had. Rest in Peace little one. Time to find a replacement...

See here for the continuation of the saga
Real Time Web Analytics