Everything explained at this link:
http://suretalent.blogspot.de/2011/07/how-to-shutdown-windows-2008-without.html
My Tips and Tricks for C#, C, C++, MatLAB, Java, LaTeX, Python and more!
Tuesday, December 29, 2015
Monday, December 7, 2015
Mastering CLASSPATH
Useful information about CLASSPATH at this link
http://kevinboone.net/classpath.html
http://kevinboone.net/classpath.html
Tuesday, December 1, 2015
How to combine gets.chomp and ARGV in a Ruby script
Are trying to learn Ruby? Nice!
You have just written a script that combines gets.chomp and command line arguments via ARGV
and you are getting this error ?
`gets': No such file or directory @ rb_sysopen
Well the solution is to modify slightly gets.chomp, it needs to be $stdin.gets.chomp
Here is a working script (example1.rb) .
# -*- coding: utf-8 -*-
puts ""
puts "Hello World (in Ruby)"
print "Insert some input here: "
user_input = $stdin.gets.chomp
print "You inserted: #{user_input} \n"
# parse 3 command line arguments...
f1, f2, f3 = ARGV
puts "First argument is: #{f1}"
puts "Second argument is: #{f2}"
puts "Third argument is: #{f3}"
Try it!
>> ruby example1.rb Hello1 Hello2 Hello3
You have just written a script that combines gets.chomp and command line arguments via ARGV
and you are getting this error ?
`gets': No such file or directory @ rb_sysopen
Well the solution is to modify slightly gets.chomp, it needs to be $stdin.gets.chomp
Here is a working script (example1.rb) .
# -*- coding: utf-8 -*-
puts ""
puts "Hello World (in Ruby)"
print "Insert some input here: "
user_input = $stdin.gets.chomp
print "You inserted: #{user_input} \n"
# parse 3 command line arguments...
f1, f2, f3 = ARGV
puts "First argument is: #{f1}"
puts "Second argument is: #{f2}"
puts "Third argument is: #{f3}"
Try it!
>> ruby example1.rb Hello1 Hello2 Hello3
Friday, November 6, 2015
How to kill a windows services that hangs on "starting" or "stopping"
To kill a Windows process that hasn't started correctly you need to use the terminal.
1) Get the name of the service from the services window (run "services.msc", select your service and then with a right click get the services name)
2) In a command prompt enter:
sc queryex <servicename>
where <servicename> is what you got at step 1)
3) Get the <PID> from the output of step 2) and use it in the command:
taskkill /f /pid <PID>
Source:
http://www.examiner.com/list/how-to-kill-a-windows-service-that-s-stuck-on-stopping-or-starting
1) Get the name of the service from the services window (run "services.msc", select your service and then with a right click get the services name)
2) In a command prompt enter:
sc queryex <servicename>
where <servicename> is what you got at step 1)
3) Get the <PID> from the output of step 2) and use it in the command:
taskkill /f /pid <PID>
Source:
http://www.examiner.com/list/how-to-kill-a-windows-service-that-s-stuck-on-stopping-or-starting
Sunday, August 30, 2015
How to sort files and folder by date in total commander... in five clicks!
TotalCommander is a great tool but by default it does not sort folders by date, it sorts them by name no matter when they were created. This is pretty annoying. However the solution is just five-clicks away :)
The first two clicks: Select Configuration -> Options...
Choose Display (the third click), and then select (fourth click) Like Files (also by time) in the Sorting directories section.
Last click for OK. :)
Enjoy!
The first two clicks: Select Configuration -> Options...
Choose Display (the third click), and then select (fourth click) Like Files (also by time) in the Sorting directories section.
Last click for OK. :)
Enjoy!
Tuesday, August 18, 2015
Python: links for the beginner
Here are some links for the people willing to learn "Python"
A tutorial:
http://hetland.org/writing/instant-python.html
A crash-course:
http://stephensugden.com/crash_into_python/
A complete online book:
http://learnpythonthehardway.org/book/
and obviously...
https://docs.python.org/2/tutorial/index.html
A tutorial:
http://hetland.org/writing/instant-python.html
A crash-course:
http://stephensugden.com/crash_into_python/
A complete online book:
http://learnpythonthehardway.org/book/
and obviously...
https://docs.python.org/2/tutorial/index.html
google's programming styles
Nice reference to the Google's programming styles in C++/Java etc
Worth to read!
http://google-styleguide.googlecode.com/svn/trunk/
Worth to read!
http://google-styleguide.googlecode.com/svn/trunk/
Sunday, August 16, 2015
GCC 4.8 on CentOS
I finally found a simple way to install gcc/g++ 4.8 (required to use c++11 syntax) on my CentOS 6 distribution!
Here is the link:
http://braaten-family.org/ed/blog/2014-05-28-devtools-for-centos/
NOTE:
I suggest you to update your .bashrc file with the following line
source /opt/rh/devtoolset-2/enable
Otherwise you cannot run the newest version of the gcc/g++!
NOTE
Adding only this line to .bashrc:
causes a fork-bomb!!!!
REFERENCES:
http://unix.stackexchange.com
http://braaten-family.org/ed/blog/2014-05-28-devtools-for-centos/
Here is the link:
http://braaten-family.org/ed/blog/2014-05-28-devtools-for-centos/
NOTE:
I suggest you to update your .bashrc file with the following line
source /opt/rh/devtoolset-2/enable
Otherwise you cannot run the newest version of the gcc/g++!
NOTE
Adding only this line to .bashrc:
scl enable devtoolset-2 bash
causes a fork-bomb!!!!
REFERENCES:
http://unix.stackexchange.com
http://braaten-family.org/ed/blog/2014-05-28-devtools-for-centos/
Sunday, June 28, 2015
eatsyscall.asm could not read symbols: File in wrong format
If you are reading Assembly Language Step-by-Step: Programming with Linux (3rd edition) by Jeff Dantemann and you came to the first program eatsyscall.asm you'll probably get this error when you link the file with the command:
ld -o eatsyscall eatsyscall.o
eatsyscall.o: could not read symbols: File in wrong format
the solution is to add another parameter to the ld command:
ld -o eatsysdemo eatsyscall.o -m elf_i386
The problem is that you are running a Linux system where both 32bit and 64bit libraries are present and ld will complain if you link libraries of different types.
Enjoy the reading.
ld -o eatsyscall eatsyscall.o
eatsyscall.o: could not read symbols: File in wrong format
the solution is to add another parameter to the ld command:
ld -o eatsysdemo eatsyscall.o -m elf_i386
The problem is that you are running a Linux system where both 32bit and 64bit libraries are present and ld will complain if you link libraries of different types.
Enjoy the reading.
Monday, June 8, 2015
Where to download Oracle Client "FULL" (Not the instant version)
To download the Full Oracle Client, not the Instant version, you need to go the download page for the Oracle Database and then select the "View All" option next to the Oracle Database for your Operating System.
For Oracle 12c this is the url
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index-092322.html
For Oracle 12c this is the url
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index-092322.html
Saturday, May 23, 2015
Top 9 java programming books on java
I found this list about the top 9 books to read for java programming, and I definitely agree!!
http://javarevisited.blogspot.de/2013/01/top-5-java-programming-books-best-good.html
http://javarevisited.blogspot.de/2013/01/top-5-java-programming-books-best-good.html
Sunday, February 15, 2015
A super reference for manipulating jar/ear/war files directly from command line
Here is the reference javaworld.com/
My favorite commands are:
// listing all files
jar tvf "fileJAR/EAR"
//updating a file in a JAR/EAR file
jar uvf "fileJAR/EAR" path/to/file/to/update
//extracting a file from a JAR/EAR/WAR file
jar xvf "fileJAR/EAR" path/to/file/to/extract
My favorite commands are:
// listing all files
jar tvf "fileJAR/EAR"
//updating a file in a JAR/EAR file
jar uvf "fileJAR/EAR" path/to/file/to/update
//extracting a file from a JAR/EAR/WAR file
jar xvf "fileJAR/EAR" path/to/file/to/extract
Friday, January 23, 2015
MySQL: a short introductory guide
Here is the link.
It covers pretty much everything the MySQL-newbie might need... installation, most used commands and some very useful tips!
This is the link you are looking for, if your goal is to learn SQL and MySQL!
It covers pretty much everything the MySQL-newbie might need... installation, most used commands and some very useful tips!
This is the link you are looking for, if your goal is to learn SQL and MySQL!
Tuesday, January 13, 2015
How to fix the error "user" is not in the sudoers file. This incident will be reported."
In order not to have this message anymore, you need to had "user" to the sodoers file.
To solve this issue, you need to log in a terminal as root (command: su) and then type the command visudo.
In the file it appears, locate the line containing:
root ALL=(ALL) ALL
and right below, add the line:
"user" ALL=(ALL) ALL
Where, obviously, "user" is the name of the user you want to add.
Close the file (ESC :w and :q OR just give ESC :x)
No more incidents to be reported! :)
To solve this issue, you need to log in a terminal as root (command: su) and then type the command visudo.
In the file it appears, locate the line containing:
root ALL=(ALL) ALL
and right below, add the line:
"user" ALL=(ALL) ALL
Where, obviously, "user" is the name of the user you want to add.
Close the file (ESC :w and :q OR just give ESC :x)
No more incidents to be reported! :)
Monday, January 12, 2015
How to configure a static IP address for a CentOS Virtual Machine
How to configure a static IP address. Here you find the useful reference I found:
http://www.doublecloud.org/
http://www.doublecloud.org/
Subscribe to:
Posts (Atom)