Skip to content

Instantly share code, notes, and snippets.

View laszlomiklosik's full-sized avatar

Laszlo Miklosik laszlomiklosik

View GitHub Profile
@laszlomiklosik
laszlomiklosik / Using JSTATD deamon with VisualVM for remote profiling
Created May 4, 2012 12:02
Using JSTATD deamon with VisualVM for remote profiling
1. create tools.policy file:
grant {
permission java.security.AllPermission;
};
2. run to start jstatd:
jstatd -J-Djava.security.policy=tools.policy
@laszlomiklosik
laszlomiklosik / Working with SVN pacthes
Created June 1, 2012 05:53
Working with SVN pacthes
# create patch from diff between remote revisions
svn diff -r OLD:NEW > ~/changes_file.diff
# create patch from diff based on local changes
svn diff > ~/changes_file.diff
# apply a patch: -p0 makes sure that all files can be found correctly, -i specifies the input diff file
patch -p0 -i ~/changes_file.diff
@laszlomiklosik
laszlomiklosik / gist:2849342
Created June 1, 2012 05:57
Script to revert to specific revision in SVN
svn merge --dry-run -r:73:68 http://my.repository.com/my/project/trunk
svn merge -r:73:68 http://my.repository.com/my/project/trunk
svn commit -m "Reverted to revision 68."
# Explanation
#Step 1 will perform a dry run and show you what the merge will produce. If you want to see exactly what changes will be applied, do a diff:
#
# svn diff -r:73:68 http://my.repository.com/my/project/trunk
@laszlomiklosik
laszlomiklosik / Create custom Ubuntu Unity Launcher
Created June 2, 2012 08:12
Create custom Ubuntu Unity Launcher
gksudo gedit /usr/share/applications/name_of_your_app.desktop
# and add the below text in the file
[Desktop Entry]
Name=Eclipse Helios
Comment=Eclipse Helios
Exec=/external/apps/eclipse-jee-helios-SR2-linux-gtk-x86_64/eclipse/eclipse
Icon=/external/apps/eclipse-jee-helios-SR2-linux-gtk-x86_64/eclipse/icon.xpm
Terminal=false
@laszlomiklosik
laszlomiklosik / Install flash player debug version on Ubuntu 64 bit
Created June 2, 2012 08:20
Install Flash Player debug version in Ubuntu 12.04 64 bit
# no 64 bit version of the flash debug player is available, thus we will use the 32 bit version and use nspluginwrapper to make it work
sudo killall -9 firefox
sudo apt-get remove -y --purge flashplugin-nonfree gnash gnash-common mozilla-plugin-gnash swfdec-mozilla libflashsupport nspluginwrapper
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
sudo apt-get install ia32-libs nspluginwrapper libcurl3 libnss3-1d libnspr4-0d
cd ~
@laszlomiklosik
laszlomiklosik / Oracle delete all user tables using a single command
Created July 23, 2012 08:32
Oracle delete all user tables using a single command
BEGIN
FOR cur_rec IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN
('TABLE',
'VIEW',
'PACKAGE',
'PROCEDURE',
'FUNCTION',
'SEQUENCE'
@laszlomiklosik
laszlomiklosik / Setting up vsftpd access in ubuntu
Created August 16, 2012 06:45
Setting up vsftpd access in ubuntu
1. sudo apt-get install vsftpd
2. nano /etc/vsftpd.conf
uncomment:
local_enable=YES
write_enable=YES
comment:
#anonymous_enable=YES
@laszlomiklosik
laszlomiklosik / Git: undo git rm for a single file
Created October 4, 2012 14:43
Git: undo git rm for a single file
git checkout HEAD path/to/file
# Without HEAD it's not working because the file is not there anymore
@laszlomiklosik
laszlomiklosik / Git view change between commits per file
Created October 4, 2012 14:44
Git: view change between commits per file
git diff commit_id1..commit_id2 -- path/to/file
@laszlomiklosik
laszlomiklosik / Configure meld as git diff and merge tool
Created October 11, 2012 19:27
Configure meld as git diff and merge tool
# inspired from http://nathanhoad.net/how-to-meld-for-git-diffs-in-ubuntu-hardy
# and http://gitguru.com/2009/02/22/integrating-git-with-a-visual-merge-tool/
sudo apt-get install meld
# create a python script with the below content and name it diff.py
#!/usr/bin/python