Skip to content

Instantly share code, notes, and snippets.

View laszlomiklosik's full-sized avatar

Laszlo Miklosik laszlomiklosik

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / Capture packages with tcpdump or tcpflow
Last active May 29, 2019 10:36
Capture packages with tcpdump or tcpflow
# packages from localhost to localhost
sudo tcpdump -vvv -A -i lo port 8080
# packages from localhost to somewhere else
sudo tcpdump -vvv -A host 192.168.1.101
# packages coming and going on a specific port, specific interface
sudo tcpdump -vvv -A -i eth0 'port 8080'
# packages coming and going on a specific port, any interface
@laszlomiklosik
laszlomiklosik / gist:2230082
Last active October 18, 2021 17:22
Sharing your Git repository using Git daemon
Sharing your Git repository using Git daemon (for pull & push)
1. In a git repository run the following command to share it in read-only mode (pull only):
git daemon --export-all --base-path=.
(from the folder with the project to be shared)
and then clone directly, like:
@laszlomiklosik
laszlomiklosik / gist:2229643
Created March 28, 2012 19:18
Enable Windows style RDP server in Ubuntu
Why would you need this?
Because NxServer or VNC needs a special client installed in order to connect.
If your destination Ubuntu machine has multiple displays installed, you will eventually go crazy configuring it to be correctly seen from a Windows machine with a single display. It will show you 2 desktops on a single monitor...
Enabling Windows style RDP server in Ubuntu in easy.
Steps:
1. sudo apt-get install xrdp
2. cd ~
3. echo "gnome-session --session=gnome-classic" > .xsession
@laszlomiklosik
laszlomiklosik / gist:2045931
Created March 15, 2012 18:39
Git/EGit SSL errors with https
# just run the below and you should be fine!
git config --global http.sslverify
#############################################################################################
# Before this EGit gave me the below error even if the SSL certificate was valid
# (from a CA, class 2 from startssl in my case)
# Cannot list the available branches.
# Reason: