Shell Input Redirections
Input Redirections:
1. < Redirecting the standard input from files.
2. << Heredoc: used to redirect input into an interactive shell script or program.
3. <<< Here string, read from a string.

bliss lane
taylor price

Love Begins
PUT YOUR BEARD IN MY MOUTH
sheepfilms
almost home
The Bowery Presents
h
EXPECTATIONS
★
Not today Justin

titsay

izzy's playlists!
Claire Keane
Lint Roller? I Barely Know Her

Origami Around

@theartofmadeline

if i look back, i am lost
tumblr dot com
The Bright Sessions
seen from Guatemala

seen from Indonesia

seen from United States
seen from United States
seen from Netherlands

seen from Brazil

seen from Brazil
seen from Australia

seen from Czechia
seen from Azerbaijan

seen from Saudi Arabia

seen from United States

seen from Australia
seen from Canada
seen from Italy

seen from Malaysia

seen from Uruguay

seen from Russia
seen from Angola
seen from United States
@heymendy-blog
Shell Input Redirections
Input Redirections:
1. < Redirecting the standard input from files.
2. << Heredoc: used to redirect input into an interactive shell script or program.
3. <<< Here string, read from a string.
Kernel signal
Kernel supports 31 non real time signals.
Typing certain keys at the terminal causes the system to send certain signals.
Some most common used are:
SIGINT( typically by pressing Ctrl-C) Terminal interrupt signal
SIGKILL(kill -q pid) Kill, cannot be caught or ignored.
SIGTERM: Termination signal, but can be caught and interpreted or ignored by the process.
Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
I got it on a Comparator I wrote, which returned either -1 or 1 (no == check was performed , and I never returned 0) .
This will happen to you usually when switching to Java 7 from older versions of Java.
Long story short , the solution was to add the following line to your Comparator :
if (o1 == o2) return 0;
A post on the HP blog answering 5 questions about Hadoop:
Why Hadoop?
What is Hadoop?
What does it do?
What is it good for?
What’s the future?
With the current momentum behind Hadoop, there’s no question that it’s here to stay. But it’s best to think of Hadoop as a starting point for interesting developments to come.
As you probably know, HP owns Vertica, a column-oriented SQL database for data warehousing and BI, but when talking about Big Data HP includes both Vertica and Hadoop.
Original title and link: Hadoop: Answering the Basic Questions: Why, What, How, Where (NoSQL database©myNoSQL)
install mongodb on windows
1. download from the website
2. unzip the file
3. create a directory to store the db files C:\Users\men08j\Documents\mymongodb
4. open cmd, cd to the bin directory
$cd C:\User\men08j\Document\mongodb\bin
$mongod --dbpath "C:\Users\men08j\Documents\mymongodb"
5. Open browser
http://localhost:28017/
6.connect to the db server
run $mongo in command line
Drop menu without button
To jump to the selected URL as soon as the selection is made (i.e. without having to click a button), use the following code:
<form name="menuform"> <select name="menu2" onChange="top.location.href = this.form.menu2.options[this.form.menu2.selectedIndex].value; return false;"> <option value="/index.html" selected>Home Page</option> <option value="/internet/index.html">Internet Tutorials</option> <option value="/internet/javascript/index.html">JavaScript Samples</option> </select> </form>
To make the selected URL open in a new window, use the following code:
<form name="menuform"> <select name="menu3" onChange="window.open(menuform.menu3.options[menuform.menu3.selectedIndex].value); return false;"> <option value="/index.html" selected>Home Page</option> <option value="/internet/index.html">Internet Tutorials</option> <option value="/internet/javascript/index.html">JavaScript Samples</option> </select> </form>
To make the selected URL open in another frame, use the following code (where "framename" is the name of the target frame):
<form name="menuform"> <select name="menu4"> <option value="/index.html" selected>Home Page</option> <option value="/internet/index.html">Internet Tutorials</option> <option value="/internet/javascript/index.html">JavaScript Tutorials</option> </select> <input type="button" name="Submit" value="Go" onClick="top.framename.location.href = this.form.menu4.options[this.form.menu4.selectedIndex].value; return false;"> </form>
FFmpeg for video editing
FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library. It can be simple called from shell.
ffmpeg has two options, '-ss' (seek to position), and '-t' (recording duration). Basically, you set up a stream copy, use -ss to go to the point where you want to start the segment, then use -t to set the length of the recording from that position. You'll have to do it once for each segment you want to create.
Try the: -vcodec copy option to copy as well as the -ss and -t options mentioned above. Example: ffmpeg -vcodec copy -ss 00:01:00 -t 00:03:00 -i infile.mpg outfile.mpg the -vcodec option chooses the video codec to use, more options are: -vcodec <string> : Force video codec. copy : Copy raw codec data as is. dvvideo : DV Video (for video editing, I've heard) ffv1 : FFV1 lossless video codec h264 : H.264 (best mpeg-4 codec, I've heard) mpeg2video : MPEG-2 Video rawvideo : RAW Video xvid : XviD ( MPEG-4 Part 2 )
Tutorials
http://www.catonmat.net/blog/how-to-extract-audio-tracks-from-youtube-videos/
http://www.catonmat.net/blog/converting-youtube-flvs-to-a-better-format-with-ffmpeg/
Git rollback to previous version
$ git log
shows the previous committed version
$ git reset --hard version_number
using GSON to convert json to java object
DataObject.java
import java.util.ArrayList;
import java.util.List;
public class DataObject{
public List<String> ids = new ArrayList<String>(){ };
}
public DataObject JSONToObject(String jsonString){
Gson gson = new Gson();
//convert the json string back to object
DataObject obj = gson.fromJson(jsonString, DataObject.class);
return obj;
}
GSON
For non-Maven user, get the Gson library from Gson official site, for Maven user, declares following dependency in your pom.xml.
<dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>1.7.1</version> </dependency>
twitter api
A good website to get user_id on twitter
http://www.idfromuser.com/
Once get the user_id, using twitter API can get lots of information of the particular user.
Like get the user followers:
"https://api.twitter.com/1/followers/ids.json?cursor=-1&user_id=" + user_id
Get the user friends(followings):
"https://api.twitter.com/1/friends/ids.json?cursor=-1&user_id=" + user_id
Tutorial for using axis in eclipse
Creating web service in Eclipse using bottom up
http://www.softwareagility.gr/index.php?q=node/29
GNOME Shell Extensions development
In order to develop the GNOME Shell Extensions, a few resources may be extremely helpful:
http://live.gnome.org/GnomeShell/Extensions
http://live.gnome.org/GnomeShell/Development
http://blog.fpmurphy.com/2011/11/updating-gnome-shell-extensions-to-work-with-gnome-3-2.html
As the extensions will not be loaded it self when GNOME Shell starts, the extension uid need to be added:
$gsettings set org.gnome.shell enabled-extensions "['[email protected]']"
then
$gsettings get org.gnome.shell enabled-extensions
it will be there Few tips for development: 1. See the log and debug information: Press Alt+F2, type lg to open the Looking Glass. P.S. Currently the debug method is logging everything. Actually You can also force a gdb breakpoint from _javascript_ with "global.breakpoint();" 2. Make GNOME Shell reload extensions after modified js files without log out: Press Alt+F2, type r to refresh.
How to create network servers in Python
python -m SimpleHTTPServer
Ubuntu Equivalent of IPconfig
Since I am using Ubuntu more, and windows less, I still need to know how to view and restart network settings in Ubuntu, as well as to be able to easily view the network settings in Ubuntu, along the lines of the windows ipconfig /all command.
The problem is that there is not one command in Ubuntu as all encompassing as the windows IPconfig command. So here is a list of various commands that are equivalent to the various options of IPconfig.
To view the basic network settings:
Windows: ipconfig Ubuntu: ifconfig
To renew your network settings:
Windows: ipconfig /release Ubuntu: sudo dhclient
then: ipconfig /renew
To view your gateway:
Windows: ipconfig / all Ubuntu: sudo route
look for "default"
To view your DNS settings:
Windos: ipconfig / all Ubuntu: cat / ect / resolv.conf
Unable to locate theme engine in module_path: "pixmap"
To fix it, run
sudo apt-get install gtk2-engines-pixbuf
bzr rm
'bzr rm foo' - will make foo unversioned and delete foo, making backups when necessary with the same rules 'bzr revert' uses.
'bzr rm foo --keep' - will only unversion (will not make backups).
'bzr rm foo --force' or 'bzr rm foo --delete' - will delete the file regardless if it is safe and will not make backups.
bzr uncommit