How to set up the classpath in jar manifest

You must break after exactly 70 characters. Otherwise the next line is not going to be treated as a continuation from the previous. There should be a leading space in all the wrapped lines, with a leading space for every line different from that with “Class-path:”. And don’t forget a new line at the end of everything! Here is an example of the manifest.

Manifest-Version: 1.0
Main-Class: xyz.HelloWorldMain
Class-Path: ./lib/log4j-1.2.15.jar ./lib/commons-logging-1.1.1.jar ./l
 ib/jstl-1.2.jar ./lib/jstl.jar ./lib/log4j-1.2.15.jar ./lib/org.sprin
 gframework.aop-3.0.2.RELEASE.jar ./lib/org.springframework.asm-3.0.2.
 RELEASE.jar ./lib/org.springframework.aspects-3.0.2.RELEASE.jar ./lib
 /org.springframework.beans-3.0.2.RELEASE.jar ./lib/org.springframewor
 k.context-3.0.2.RELEASE.jar ./lib/org.springframework.context.support
 -3.0.2.RELEASE.jar ./lib/org.springframework.core-3.0.2.RELEASE.jar .
 /lib/org.springframework.expression-3.0.2.RELEASE.jar ./lib/org.sprin
 gframework.instrument-3.0.2.RELEASE.jar ./lib/org.springframework.ins
 trument.tomcat-3.0.2.RELEASE.jar ./lib/org.springframework.jdbc-3.0.2
 .RELEASE.jar ./lib/org.springframework.jms-3.0.2.RELEASE.jar ./lib/or
 g.springframework.orm-3.0.2.RELEASE.jar ./lib/org.springframework.oxm
 -3.0.2.RELEASE.jar ./lib/org.springframework.test-3.0.2.RELEASE.jar .
 /lib/org.springframework.transaction-3.0.2.RELEASE.jar ./lib/org.spri
 ngframework.web-3.0.2.RELEASE.jar ./lib/org.springframework.web.portl
 et-3.0.2.RELEASE.jar ./lib/org.springframework.web.servlet-3.0.2.RELE
 ASE.jar ./lib/org.springframework.web.struts-3.0.2.RELEASE.jar .

Eclipse / Java code complition not working

Try restoring the default options in ‘Windows > Preferences > Java > Editor > Content Assist > Advanced

An example of the kind of data you see in this preference screen, however not necessarily what you currently have.

eclipse content assist setting

That was the only way that worked for me. I restored my code complition.

Important Shell script commands which are oft used

Here is a list of some important shell commands:

—- Using Screen command
screen -ls — for a list of avaliable active screens
screen -x …. – the Name from -ls output to join to this active screen
Go out of the Screen with ‘ctrl a+d’ without stopping it

—- Harddisk and folder size
df -h – filesystemsize
du -sh * – shows the size of every folder

—- Who
whoami – list current user in current window
who – list all users logged onto the Workstation

—- Copy file to other Computer
scp filename [email protected]:/filepath
filename is the file to copy and the rest is the Informationen for the remote Computer. You will be asked for a Password of the remote user.

—- Show Users List
cat /etc/passwd | cut -d: -f1

—- System information commands
dmesg – (for “diagnostic message”) is a command on Unix-like operating systems that prints the message buffer of the kernel. This buffer contains a variety of important messages from those printed during boot to those used for debugging software.
lspci -tv – Shows bridjes and main board
lshw – Information about installed devices
/usr/sbin/prtconf -v | more – Shows the RAM in Unix System

—- Show Linux version
uname -r
cat /proc/version

—- kill commands
kill -15 pid — is graceful Kill
kill -9 pid — is forcible Kill

—- Shows which files are open from the process
pfiles processid

—- Find a file per name
find /as -name *stat

—- Debug script
sh -x script

—- Vi commands
esc – in command mode
a – append
i – insert
q – quit
w – write
x – backspace
d – delete

shift g – springt am last line of text
:^g – list current line number
:set number – show line numbers

Cut/Paste Commands:

x – delete one character (destructive backspace)
dw – delete the current word (Note: ndw deletes n numbered words)
dd – delete the current line (Note: ndd deletes n numbered lines)
D – delete all content to the right of the cursor
d$ – same as above
:u – undo last command

Searching and Substitution commands:

/ [string] – search forward for string
? [string] – search backwards for string

Entering the Insert Mode:

i – Begin inserting text at current cursor location
I – Begin inserting text at the beginning of the current line
a – Begin appending text, one character to the right of current cursor location
shift a – Begin appending text at the end of the current line
o/O – Begin entering text one line below\above current line
ESC – Exit insertion mode and return to command mode

—- Less commands
g – go in the begining
shift g – go ende
shift 7 – Search
shift ß – Search backwards
n – go to next search match
shift n – go to before search match

—- find command
find . -name “*Sync*” -exec grep -l “501000093347053” {} \;
– finds in the current Folder all files with Name Sync, who have the string XXXX in it

—- Move files with script
ls junk* | awk ‘{print “mv “$0″ ../iraf/”$0″.dat”}’ | csh

—- Using Nohup with sqlplus
nohup sqlplus username/password @/home/sdmtest/..sql name & — the Output is in nohup.out

— remove all empty lines from a file
egrep -v ‘^$’ nohup.out > newfile.txt

—- tr command
tr [-c] [-d] [-s] [string1] [string2] output_file.txt
-c Complement the set of characters specified by string1.
-d Delete all occurrences of input characters that are specified by string1.
-s Replace instances of repeated characters with a single character.
string1 First string or character to be changed.
string2 Second string or character to change the string1.

tr -d ‘\t’ newfile — delete all Tabs from a File

—- ls commands
ls -lrt — Shows sorted file output

— show Variables value
echo $variable Name – Shows the variable
set – list of all set Variabels

—- Archivieren
tar -cf – file.dat | gzip -c > blabla.tgz — file.dat will be archived in blabla.tgz
tar -cf – * | gzip -c > blabla.tgz — all files from the Folder will be added to archive

– Shows whats in Archive without unzip
gunzip -c blsbvs.tgz | tar tvf –

– unzip only some files from archive
gunzip -c datejname | tar -xf – dateinamen mit pfad

– better compression
cat file1 file2 | gzip > foo.gz

– list the contents of a tar.gz file
tar -ztvf file.tar.gz
# t: List the contents of an archive
# v: Verbosely list files processed (display detailed information)
# z: Filter the archive through gzip so that we can open compressed (decompress) .gz tar file

—- delete recursively a folder with all elements in it
rm -r foldername

— change owner
ls -l – see user – group
chown user:group filename

— change file access rights
chmod u=rwx, g=rwx filename
chmod 777 filename

—- Examples for regular expressions:

# smug {search files for lines with ‘smug’}
# ‘^smug’ {‘smug’ at the start of a line}
# ‘smug$’ {‘smug’ at the end of a line}
# ‘^smug$’ {lines containing only ‘smug’}
# ‘\^s’ {lines starting with ‘^s’, “\” escapes the ^}
# ‘[Ss]mug’ {search for ‘Smug’ or ‘smug’}
# ‘B[oO][bB]’ {search for BOB, Bob, BOb or BoB }
# ‘^$’ {search for blank lines}
# ‘[0-9][0-9]’ {search for pairs of numeric digits}
# ‘[a-zA-Z]’ {any line with at least one letter}
# ‘[^a-zA-Z0-9] {anything not a letter or number}
# ‘[0-9]\{3\}-[0-9]\{4\}’ {999-9999, like phone numbers}
# ‘^.$’ {lines with exactly one character}
# ‘”smug”‘ {‘smug’ within double quotes}
# ‘”*smug”*’ {‘smug’, with or without quotes}
# ‘^\.’ {any line that starts with a Period “.”}
# ‘^\.[a-z][a-z]’ {line start with “.” and 2 lc letters}

—- Unix Commands list
http://www.computerhope.com/unix.htm

How to sign Jars. Signing Jars for use in Applets.

As the Browsers now want the Jars to be signed it happens oft that man have to sign a Jar himself.

Here is a Manual how to sign a Jar.

First you have to install Java SDK.

http://www.oracle.com/technetwork/java/javase/downloads/index.html?ssSourceSiteId=otnjp

Install the JDK from the list for the envitonment you use.

This Manual is made for Windows users. Set the JAVA_HOME variable and put the JAVA/bin folder in path in order to use the Java commands.

Now you can create your keystore and key pair. Navigate to your home folder as C:\Users\username and execute the following command there in console.

  • Generate a Java keystore and key pair
    keytool -genkey -alias mydomain -keyalg RSA -keystore .keystore

    You should answer some questions and in the end you end up with genrated keystore named .keystore and the key pair. You should write down the password for the keystore as it is important and will be used after that.

    Now navigate to the folder with your Jars and execute the folling commands in console:

    jarsigner -sigfile SIG -signedjar SignedApp.jar jar-to-sign.jar alias
    jarsigner -verify SignedApp.jar

    As in the place of alias put your alias you entered by Generation of the keystore. Jar-to-sign is the jarname you need to sign.
    The verify is made to verify is the jar really succesfully signed.

    Thats it.

    Happy signing.

Setting up development environment on Windows for developing in C and C++. Install MSYS shell environment, the MinGW C++ compiler and eclipse cpp

1. Installing the Eclipse cpp for C and C++

Download the latest version of the eclipse cpp from here:
https://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/heliossr2

Install it. Start eclipse and make changes in Project build to build only with ‘make’ command and not with ‘make all’.

2. Installing the mingw-get installer

Download the latest version of the mingw-get installer. To do it, click on the following link

http://sourceforge.net/projects/mingw/files/latest/download

to go to the mingw-get installer automated builds download webpage at SourceForge. Once you reach the webpage, click on the file for last version of mingw. This will start the downloading of the mingw-get installer. When prompted if to open or to store the file in your computer, select the appropriate option to store file on your computer.

Once the MinGW installer is in your PC, right-click upon it to extract its content. If you are asked for  Installation folder use  “C:\MinGW\”. Sonst move or copy the “MinGW” folder after Installation into the folder “C:\MinGW\”.

Installing the MinGW

Download the latest version of the MinGW . To do it, click on the following link

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

to go to the MinGW automated builds download webpage at SourceForge. Once you reach the webpage, click on the file for last version of mingw. This will start the downloading of the MinGW . When prompted if to open or to store the file in your computer, select the appropriate option to store file on your computer.

Once the MinGW installer is in your PC, right-click upon it to extract its content. If you are asked for  Installation folder use  “C:\MinGW\”. Sonst move or copy the “MinGW” folder after Installation into the folder “C:\MinGW\”.

After install rename the mingw-make.exe to make.exe. It is situated in C:/MinGW/bin folder.

3. Installing the MSYS

Now, to download MSYS Environment go to the following link:

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/

and click for the last MSYS version binary. After the download is finished, extract it to “C:\MinGW”.

Installing msysDTK

http://sourceforge.net/projects/mingw/files/Other/Unsupported/MSYS/msysDTK/msysDTK-1.0.1/msysDTK-1.0.1.exe/download?use_mirror=cznic

Download and install in C:\MinGW\msys\1.0

4. Configuring MSYS to use with MinGW

After the installation is completed, open a MSYS shell console at “C:\MinGW\msys\msys.bat” and type:

sh /postinstall/pi.sh
  • Type “y” to continue with the installation.
  • Type “y” to say that MinGW is installed.
  • Enter “c:/MinGW” as the MinGW installation location.

5. Environment Settings

When you install command line tools, such as MinGW, or GnuWin32 tools, you have to tell the command line interpreter where to find them. This is usually accomplished by adding the appropriate directory names to the PATH variable in your user environment. The installers will not do this for you.

NOTE If you choose to alter your PATH variable, you must ensure you alter your user PATH variable, not your system PATH variable — there are two of them!

NOTE The MinGW team do not recommend modifying the system wide Windows PATH variable. We prefer that you use a script to set PATH for the processes on a per session basis. See the notes in the “After Installation You Should” section above.

Warning: Adding entries to the PATH is normally harmless. However, if you delete any existing entries, you may mess up your PATH string, and you could seriously compromise the functioning of your computer. Please be careful. Proceed at your own risk.

  1. Right-click on your “My Computer” icon and select “Properties”.
  2. Click on the “Advanced” tab, then on the “Environment Variables” button.
  3. You should be presented with a dialog box with two text boxes. The top box shows your user settings. The PATH entry in this box is the one you want to modify. Note that the bottom text box allows you to change the system PATH variable. You should not alter the system path variable in any manner, or you will cause all sorts of problems for you and your computer!
  4. Click on the PATH entry in the TOP box, then click on the “Edit” button
  5. Scroll to the end of the string and at the end add
    ;<installation-directory>\bin
  6. press OK -> OK -> OK and you are done.

NOTE: Substitute <installation-directory> with the FULL absolute path name of the installation target directory you chose (ie C:\MinGW);

If you installed MSYS, you may also want to add “;<installation-directory>\MSYS\1.0\bin”, and “;<installation-directory>\MSYS\bin” to the end of your user PATH variable.

6. Install Additional MinGW Packages

Start a MSYS shell. In the shell window, execute the following commands:

mingw-get install libz
mingw-get install bzip2
mingw-get install msys-man

7. Install GnuWin32 Packages

he GnuWin32 project is a collection of open source programs and libraries ported to Windows. These also work well with the MinGW compiler, and Icarus Verilog uses a few pieces from this collection.

From the GnuWin project, download the following packages:

  • gperf-3.0.1-bin
  • readline-5.0.1-bin

NOTE: You need the binaries and the developer files, but you do not need the source to these packages.

From the downloaded gperf-3.0.1-bin zip archive:

  1. drag and drop bin\gperf.exe to <mingw>\bin

From the downloaded readline-5.0.1-bin zip archive:

  1. drag and drop bin\* to <mingw>\bin
  2. drag and drop lib\* to <mingw>\lib
  3. drag and drop include\* to <mingw>\include

where <mingw> is the location you chose to install MinGW.

NOTE: readline is only required to enable command line editing when in the vvp interactive mode

 8. Install Git for Windows

NOTE: Skip this step if you only wish to build from snapshots.

From the http://msysgit.github.io/ , download and install the Git for Windows binary package.

NOTE: When installing, you must select the option of “Checkout as-is, commit Unix-style line endings”.

The installation will leave a “Git Shell” icon on the desktop and in the Git sub-menu of your Start menu. This icon brings up a shell window (a command line) that has paths all set up for executing Git commands.

9. Get the Git Source

NOTE: Skip this step if you don’t want to build Git.

Start a Git shell. In the Git shell window, change directory to the location where you wish to store the source code and execute the following command:

git clone git://repo.or.cz/git/mingw.git git

This will create a directory “git” that contains all the source code for git.

The path to the directory containing the source code is referred to as <git-source> in subsequent instructions.

NOTE: Make sure there are no spaces in the <git-source> path names. Use forward slashes in place of back slashes when using <git-source> in a MinGW Shell.

10. Build and Install Git

NOTE: Skip this step if you don’t want to build Git.

In the MinGW shell window, execute the following commands:

cd <git-source>
make NO_OPENSSL=YesPlease NO_TCLTK=YesPlease NO_GETTEXT=YesPlease INSTALL=/bin/install prefix=/usr/local install

You can now uninstall the Git for Windows binary package if you wish, as Git commands can now be executed in the MinGW shell.

Files To Get

Download at least the following (or newer) packages from the MinGW Download Page. Where two or more component packages are indicated, you need both / all of them.

  • binutils (bin and dev)
  • mingw-runtime (dev and dll)
  • w32api
  • Required runtime libraries for GCC:
    • mpc (dev and dll)
    • mpfr (dev and dll)
    • gmp (dev and dll)
    • pthreads (dev and dll)
    • iconv (dev and dll)
    • zlib
    • gettext
  • gcc-core (bin and dev and dll)

The above are the minimum requirements for a working C Language compiler using the MinGW GCC toolchain.

You can also add one or more of the following optional compilers or tools. For each you choose to install, you need all three of the bin, the dev and the dll component packages:

  • gcc-c++ (bin and dev and dll) for C++
  • gcc-objc (bin and dev and dll) for Objective C
  • gcc-fortran (bin and dev and dll) for Fortran 90/95
  • gcc-java (not yet available) for Java
  • gcc-ada (bin and dev and dll) for Ada

Note that the GCC versions of these files must match the GCC version of the gcc-core installed.

You can also add the following additional utilities:

  • mingw-gdb and libexpat for debugger
  • mingw32-make for make
  • mingw-utils for MinGW Utilities

Start mining bitcoins. How to setup my environment in Windows?

Bitcoin is an innovative payment network and a new kind of Money. Start mining Bitcoins now. Falls your Computer works all day long it can make also Money for you. Start bitcoin minig.

It is very easy. Just follow this Manual and you start mining in no time.

1. First step is to make yourself a Bitcoin wallet. Go to https://blockchain.info and make yourself a wallet.

2. Second step is to Register in a Bitcoin Poll. Here is a list of pools recommended  https://en.bitcoin.it/wiki/Comparison_of_mining_pools

I recommend 50BTC and deepbit.net

When you register in the pool make sure you created a worker and created worker password as they are needed for Bitcoin mining.

Don’t Forget to put your Bitcoin Wallet Address in the Pool as they will pay your Shares on your account.

3.Third Step start minnig. Install mining Software.

Install and start Bitcoind core.

https://bitcoin.org/de/download

Install APP SDK on your Computer. It is AMD OpenCL™ Accelerated Parallel Processing (APP) technology is a set of advanced hardware and software technologies that enable AMD graphics processing cores (GPU), working in concert with the system’s x86 cores (CPU), to execute heterogeneously to accelerate many applications beyond just graphics.

http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/amd-accelerated-parallel-processing-app-sdk/

Install one of the bitcoin miners avaliable. Every pool recomends a list of miners. I recommend you GPU/CPU :: m0mchil’s python miner.

Here you can download the zip with the programm where is also the exe file, the exe for Windows:

http://www.softpedia.com/dyn-postdownload.php?p=188160&t=0&i=1

https://github.com/downloads/m0mchil/poclbm/poclbm_py2exe_20110709.7z

Here are the sources if you want to know what the program does.

https://github.com/m0mchil/poclbm

Start mining command as example here with mining pool deepbit.net in the poclbm program folder where the poclbm.exe is. Execute the command in console. It is important to see the console output:

——————————————————————————————————————————————-

poclbm.exe -d0 -v –platform=1 –host=pit.deepbit.net –port=8332 –[email protected] –pass=password

——————————————————————————————————————————————-

It is important to set correct the device and the platform. For my Computer these are the options -d0 that means set device 0 which means NVIDIA GTE 755m and –platform=1 here is set Plattform 1 which means NVIDUA CUDA. In order to find out the deices and platforms on your Computer execute the command above in Windows console without -d and –platform options. The Programm offers than the right numbers and devices to choose from. The program allows GPU mining which means using your graphic card for mining or CPU mining which means using your CPU – Computer core for mining.

As for now with the normal Computer man can make some 10 Cent a month. This is not much. But it is comming the new bitcoin miner that will change that. Its Name is DiamantMiner. Keep a close watch of this thread https://bitcointalk.org/index.php?topic=548438.0;all

As for now the bitcoin mining is made with Special Hardware made for mining. There are big Computer farms in USA for bitcoin mining that are making hundreds thousands of Dollars in a month revenue.

The DiamantMiner will change everything.

And as I say Happy Mining to all of you.

If you like post Donate in Bitcoins to:

13MSzfPPr4gXvusKJFAFR2EANNe59Xyxqj

 

 

How to install testdisk on Ubuntu and to add universe repository

Execute the command in console in Ubuntu. The commands are made for  Ubuntu 12.04 LTS (Precise Pangolin). For your Ubuntu Version replace “precise” in these commands with your Ubuntu Version name:

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu precise universe miltiverse"

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu precise-updates universe miltiverse"

sudo apt-get update

sudo apt-get install testdisk

testdisk device

You can use also alternative

fsck.ext4 -p device

For further Information how to use testdisk visit the following sites.

http://www.cgsecurity.org/wiki/TestDisk

http://www.cgsecurity.org/wiki/Data_Recovery_Examples