Install Oracle Java on Ubuntu the easy way
I cannot vouch for the quality or integrity but my guess is that it is legit.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
I cannot vouch for the quality or integrity but my guess is that it is legit.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Note to self:
ClojureScript interface to Facebook's React
A clojurescript interface to a javascript library
Update: Did not work that well on my Ubuntu 13.10; seems to have hard coded names for stuff that have other names on Ubuntu.
Requires package libav-tools on Ubuntu 13.10 .
youtube-dl is a small command-line program to download videos from YouTube.com
Read more: Link - youtube-dl
Impressive demos, including picture in picture. Uses ffmpeg and numpy.
Read more: Link - MoviePy — MoviePy 0.2 documentation
Summary:
Type
openssl version
With the recent disclosure of the long standing heartbleed bug, it is a god idea to check what version of openSSL you are actually running. Just type openssl on the command line followed by the word "version". According to this page, the versions that are compromised are
Well actually two, but you stick them in one file that gets executed in bash:
ssh -fN -L 5900:localhost:5900 remotserver.example.com vncviewer -encoding tight -quality 5 localhost:0
The -N switch prevents commands to be sent to the remote host, the -f switch allows the terminal to come back and prompt for a vnc password that is triggered by the second line.
Warning: Haven't figured out how to exit cleanly. However the top rated answer here might do the trick:
Bash script to setup a temporary SSH tunnel - Stack Overflow
Tightvnc used in this case:
vncviewer -encoding tight -quality 5 localhost:1
It gets harder and harder to install a python 2.4 buildout on Ubuntu and Debian. Basically, the different scripts involved will try to execute code that is not compatible with python 2.4 at every step of the way. I need python 2.4 for some old Plone 2.5 sites. Here is what I did to get it running this time, tested both on Ubuntu 10.4 and Debian 7:
Use a separate virtualenv script, so do not rely on the one installed in the system which is made for another python version. Instead download a standalone script of some vintage:
wget --no-check-certificate https://raw.github.com/pypa/virtualenv/1.7.2/virtualenv.py
Setup the virtual environment like so:
python2.4 virtualenv.py .
It will crash when trying to install setuptools, but by then it has installed python.
Now you should have a working python.
Time to install a setuptools that actually works. Version 1.4.2 works (somewhat selected at random, you can try newer ones if you like). That version is not linked from the https://pypi.python.org/pypi/setuptools page, but with some detective work it can be found at:
https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz
Download and unpack it and install it in the old-fashioned way:
./bin/python setuptools-1.4.2/setup.py install
Time to install easy_install. Download the script from:
http://peak.telecommunity.com/dist/ez_setup.py
Then install easy_install with:
./bin/python ez_setup.py
Time to install zc.buildout:
./bin/easy_install zc.buildout==1.4.4
In your buildout.cfg file, you must also pin setuptools to the version you have installed. Otherwise, you guessed it, zc.buildout will download and fail to run a newer incompatible version of setuptools:
[versions] setuptools = 1.4.2
And there you go:
./bin/buildout
I had the need for a quick and easy way to publish a table on some free web publishing service. The table must be easy to edit. However finding a free blog site or web publishing site where you can add tables in the wysiwyg editor turned out to be not that easy. In fact I have not found one yet:
Wordpress.com
|
no wysiwyg tables. There are plugins for wordpress that have this, but they are not available at wordpress.com, at least not for free. |
Tumblr.com
|
no wysiwyg tables |
Livejournal.com
|
no wysiwyg tables and has peculiar ideas about password security and annoying captchas |
blogspot.com
|
no wysiwyg tables |
blogetery.com
|
Is supposed to have some wordpress plugins, which ones they are is not listed, but signup does not work whether using Firefox or Chrome from Ubuntu, so it will remain a mystery. |
angelfire.lycos.com
|
has a table "plugin" but it disappears when you try to click it in Google Chrome or Firefox |
notehub.org
|
has markdown publishing, but does not support the markdown table format |
Update 2015-03-23: It seems that the program get privileges to both accounts. If I start Firefox with it, it can read both from my account's files and the the account that sox runs it as.
sux seems to do the job. If you are on Ubuntu:
sudo apt-get install sux
sux other_user_name gui_program_to_run
You may need to include the full path to the program you want to run, e.g. if is a Windows program to be run under wine
sux other_user_name wine /path/to/program
Haven't tried without full path though.
There is a "hidden" setting in Gnome that allows you to use two fingers on the touchpd (trackpad) to emulate right click (context click). Read more here:
http://askubuntu.com/questions/331605/simulate-right-click-in-laptop
The instructions are for Ubuntu, but the user appociappo's instructions worked like a charm on Debian 7. It contains a patch to setup.py, and flags for the C compiler and loader:
Link - [ubuntu] compile python 2.4 and 2.6 on 12.04 x86_64
Furthermore, if you are using bootstrap.py for e.g. a Plone buildout, this bootstrap.py seems to work:
Boot with a live CD or live USB. Assuming that your install is availableat /dev/sda1, then, quoted from:
http://askubuntu.com/questions/112957/display-works-fine-in-livecd-but-not-in-full-installation
sudo mkdir -p /media/ubuntu
sudo mount /dev/sda1 /media/ubuntu
Then you need to mount the proc, dev, and sys filesystems into your new environment:
sudo mount --bind /dev /media/ubuntu/dev
sudo mount --bind /proc /media/ubuntu/proc
sudo mount --bind /sys /media/ubuntu/sys
Finally, chroot into it:
sudo chroot /media/ubuntu
Now edit /etc/default/grub, uncommenting out the line
GRUB_GFXMODE=640x480
and then run
sudo update-grub
There is a script walk-through at the bitcoin wiki. It is not all that easy to understand, since it could be formatted and presented better. I show here the current table as it looks on the Wiki, and then further down my hopefully improved version. Here is what the original looks like:
Checking process:
Stack | Script | Description |
---|---|---|
Empty. | <sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | scriptSig and scriptPubKey are combined. |
<sig> <pubKey> | OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | Constants are added to the stack. |
<sig> <pubKey> <pubKey> | OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | Top stack item is duplicated. |
<sig> <pubKey> <pubHashA> | <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG | Top stack item is hashed. |
<sig> <pubKey> <pubHashA> <pubKeyHash> | OP_EQUALVERIFY OP_CHECKSIG | Constant added. |
<sig> <pubKey> | OP_CHECKSIG | Equality is checked between the top two stack items. |
true | Empty. | Signature is checked for top two stack items. |
So, in order to understand this, there are a couple of things that are kind of obscure in that table, namely:
It might be cleaner to do like this instead:
Then it becomes like this:
Checking process:
Entire script is:
<sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
Stack | Script | Description |
---|---|---|
Empty. | <sig> <pubKey> | scriptSig and scriptPubKey are pushed onto the stack. |
|
OP_DUP | Top stack item is duplicated. |
|
OP_HASH160 | Top stack item is hashed. |
|
<pubKeyHash> | Constant pubKeyHash is pushed onto the top of the stack,. |
|
OP_EQUALVERIFY | Equality is checked between the top two stack items. If not equal, script returns false and transaction is invalidated |
|
OP_CHECKSIG | .Signature is checked for the two remaining stack items. |
true | Empty. |
If you use different devices for your XMPP chat, it can be a chore to have different nicks just so that you do not get kicked out or blocked when you log in from device number 2.
Newer versions of ejabberd (13.10 tested) allows this by default, however the old version (2.1.2) shipped with Ubuntu 10.4 does not. Openfire did not allow it in the version I tested, and it seems that it is not possible.
Just a note to self:
Create and configure lightweight, reproducible, and portable development environments.
Read more: Link - Vagrant
Taken from: Link - How to format a USB flash drive? - Ask Ubuntu
sudo fdisk -l
It will show all the volumes. My stick was at /dev/sdb1 .
Change /dev/sdb1 if the USB stick isn't there and enter its correct address.
If the USB stick is at /dev/sdb1, unmount it with:
sudo umount /dev/sdb1
Then format it with fat32 like so:
sudo mkfs.vfat /dev/sdb1
Oftentimes, I'd like to edit a div in Wysiwyg mode. But the Wysiwyg editors that I use (TinyMCE and CKEditor) do not seem to show divs in an easy way. They do show tables, with borders and all, and I assume the same could be done for divs.
I'd like to see where the divs are, be able to create a div, preferrably by selecting a piece of text and do a "wrap in div" command or some such. And I want to be able to select a div in Wysiwyg mode, and edit its CSS classes.
I guess you could go through their source code and model a div editing capability on the table editing capability.
Hmm, I just realized that showing the divs is just a matter of editing the CSS for the edit view. Half the problem solved.
Div container manager looks promising, but I am not entirely sure of how to integrate it into my CMS, Plone. Just including the file does not work, and additionally adding "div" to the Plone toolbar configuration does not work either.
For TinyMCE there is visualblocks.
Check what branches are available at remote:
git remote show origin
Then do:
git fetch origin remote_branch_name:local_branch_name
Do a fetch first
git fetch
and then compare the branches with
git diff HEAD...origin
Do :
git merge origin/other_branch
while being in your branch.
A
git pull --all
followed by a a
git merge other_branch
won't work. "git pull --all" fetches all tracked remotes and updates them, but only merges new updates on your current branch. So even if other branches are updated locally, HEAD hasn't moved in them and from merge's point of view the updates aren't there.
In subversion you can do “theirs-full” as a merging strategy. You used to be able to do that in git too, but it has been deprecated and outright removed. Here is one way of doing a theirs-full. You simply move to the incoming branch, branch it into a temporary branch, switch to master and merge that one into yours
git checkout -b temporary origin/incoming git merge -s ours master # ignoring all changes from master git checkout master git merge temporary # fast-forward to tmp HEAD git branch -D temporary # deleting tmp
See more at:
http://stackoverflow.com/questions/4911794/git-command-for-making-one-branch-like-another
If you want the incoming branch to completely take over, there are a couple of ways of doing that. Assuming the incoming branch is called “incoming”, and that you are on the “master” branch:
git reset --hard incoming
-or-
git branch -d master git checkout incoming git -b master
-or-
git checkout -f -b master incoming
Before you do any of the above you may want to create a branch for your old work, or it is effectively rendered inaccessible. Note that any files from your original master not present in incoming, will be ignored.
How do I initialize a remote repository with my stuff and make my local repository track the remote?
$ git remote add origin git@gitserver:/opt/git/project.git $ git push origin master
If the remote repository is fresh and does not have any branches in it, it does not know where to store your stuff, even if you are on master. Use:
git push --all
It will create the necessary branches on remote and effectively copy all your branches over, including the one that you are on.
See:
http://stackoverflow.com/questions/6157730/why-cant-i-push-to-this-bare-repository
git does not push tags to remote servers unless you specify that explicitly
git push --tags
...for all tags.
git push <tagname>
...for a named tag
You need to use
git push -u origin branchname
It will also set up your local branch to track the remote one.
Do not just do a
git push
, because that will push master to master on remote, even if you are on your new local branch.
git push --all
should work too, if you want to push all branches to remote.
git remote -v
shows you what you’ve got
A local branch can track a remote branch. git clone automatically sets up this
git checkout -- .
git reset HEAD filename
Undo your last commit and bring your workspace and staging area back to the state of the last commit:
git reset --hard HEAD~1
if you want to keep your workspace as it is now:
git reset HEAD~1
if you only want to undo the commit but keep both your index (staging area) and your work space as they are now:
git reset --soft HEAD~1
Any of these resets will erase your most recent commit from the commit history! There are ways of getting it back but it is a bit of work.
See: http://stackoverflow.com/questions/927358/how-to-undo-the-last-git-commit
Hit Ctrl-c to exit the merge tool dialog
If your git is 1.7.4 or newer:
git merge --abort
If your git is older than 1.7.4:
git reset --merge HEAD
git clean -f
(but this latter will remove all untracked non-ignored files, may not be want you wanted, however you should had made sure of a clean state before the merge, and then its cool)
One would have thought that git stash would help here, but you cannot stash merge conflicts, so it is not an option
You may see it staged for deletion. Then do a checkout to the branch you are already on, for that particular file:
git checkout -- file_that_was_deleted
It works without the “--”, but since your file name may correspond with a branch name it is best to put “--” in.
You can use sub modules in a fruitful way if you’re on git 1.8.2 or later:
http://stackoverflow.com/questions/9189575/git-submodule-tracking-latest/9189815#9189815
http://www.vogella.com/articles/Git/article.html#submodules
Github and bitbucket already run by default on newer versions. So does newer versions of Ubuntu.
If you are on an older Ubuntu, use:
sudo add-apt-repository ppa:git-core/ppa
from: https://launchpad.net/~git-core/+archive/ppa
git submodule add -b branch <url> dirname git submodule add -b master ssh://git@git.example.com/srv/git/awesome_lib.git awesome_lib
When you clone the parent repository, the submodule does not get cloned into its sub directory. For that you have to do:
git submodule init git submodule update
This seems quite involved, but I have successfully done so, following these instructions:
You can’t. Commit an empty .gitkeep file in there and it works though.
Allows for staging just parts of a file, good when you want to make a commit that does not fix two or more things at once.
git add -u will add all changed files it knows about to the staging area, from where you issue the command and recursively downwards. In other words, if you do git add -u in a subdirectry, only changes within that subdirectory will be staged.
Tell bootstrap to use an earlier zc.buildout version Run bootstrap.py with the -v option, forcing it to stick to a specific, earlier version: $ bin/python bootstrap.py -d -v 2.1.1