$ update-rc.d -f nginx remove
Tuesday, July 29, 2014
Disable NGINX autostart in Ubuntu 14.04
Monday, February 10, 2014
My ssh protocol handler for Firefox and under Linux
#!/bin/bash
address=`echo $1 | sed -e "s/ssh:\/\///" | sed -e "s|:....||"`
str=$1
n=4
port=`echo ${str:${#str} - $n}`
gnome-terminal -e "ssh ${address} -p ${port}"
Put this in a file and set it as executable. I put mine in ~/.bin/sshhandler
(chmod +x ~/.bin/sshhandler)
in firefox go to about:config
add new boolean value called
network.protocol-handler.expose.ssh
Set it to false.
In Firefox navigate to an ssh:// url and select the script as the application to handle them.
This should handle urls formatted in the following manner:
ssh://user@hostname:port
address=`echo $1 | sed -e "s/ssh:\/\///" | sed -e "s|:....||"`
str=$1
n=4
port=`echo ${str:${#str} - $n}`
gnome-terminal -e "ssh ${address} -p ${port}"
Put this in a file and set it as executable. I put mine in ~/.bin/sshhandler
(chmod +x ~/.bin/sshhandler)
in firefox go to about:config
add new boolean value called
network.protocol-handler.expose.ssh
Set it to false.
In Firefox navigate to an ssh:// url and select the script as the application to handle them.
This should handle urls formatted in the following manner:
ssh://user@hostname:port
Friday, February 07, 2014
Change file extension for a batch of files
for files in *.txt
do
mv "$files" "${files%.txt}.csv"
done
do
mv "$files" "${files%.txt
done
Friday, January 31, 2014
Online expanding of a VMWare linux server LVM Volume
Add the hard drive to the running VM.
dmesg (figure out what the device name is for the new device like /dev/sdf)
parted /dev/sdf
mklabel msdos (inside parted)
quit (inside parted)
pvcreate /dev/sdf
vgextend VolGroup00 /dev/sdf
lvextend /dev/mapper/VolGroup00-LogVol00 /dev/sdf
resize2fs /dev/mapper/VolGroup00-LogVol00
Thursday, January 30, 2014
Compress and transfer in one step
This command uses tar to compress a directory and store it into a file located on a remote system. Handy.
$ tar vzcf - /path/to/data | ssh user@remotesvr `cat - > /backups/data.tgz`
Pure command line if then without the if or then
The && and || can be used to control command flow like if then...
$ /use/bin/somecmd && echo "it worked!" || echo "epic fail!"
Labels:
cmd-fu,
conditional,
flow control,
Linux
Process list filtering with grep
Adding the square brackets prevents the grep command from showing up in the process list.
$ ps -ef | grep proces[s]
Icinga log parsing perl command
The perl command changes unix time to human readable time in the output... Very useful for searching the check log archives.
Labels:
cmd-fu,
Icinga,
Linux,
log parsing,
perl
Wednesday, May 23, 2012
How to calculate frequency:
Wolfram Alpha: 1 second * in Hz
Example: 1 second * 0.0005 in Hz
returns: 2000Hz or 2kHz
Example: 1 second * 0.0005 in Hz
returns: 2000Hz or 2kHz
Tuesday, July 26, 2011
Procmon
Copy procmon.exe and psexec.exe to c:windowssystem32
psexec -i -s -d procmon.exe
This command runs procmon interactive as the system account.
You can use this to troubleshoot Citrix user permissions issues.
Filter based on result "ACCESS DENIED"
Labels:
cmd-fu,
command,
permissions,
sysinternals
Thursday, December 02, 2010
Guide: Portable Tor Browser with Google Chrome
If you're into online privacy and anonymity then you already know about The Tor Project. It is the standard for keeping yourself and your browsing habits private and anonymous online. The Tor project has a portable version of their software which includes the Firefox web browser (portable version of course.) This guide will help you setup this portable version of Tor to use Google Chrome instead of Firefox for those of us who don't really like Firefox.
First thing you need to do is download the self extracting executable for Tor Browser. You can extract the contents of this package anywhere you want and use Tor Browser to browse the internet safely on any computer you can stick a USB stick in. In order to replace Firefox as the default browser for the package continue reading.
The next thing you need to do is download ChromePlus. ChromePlus is a version of Chrome that is portable and based on the open source version of Chrome called Chromium. I had basically two choices for the portable version of Chrome to incorporate into the Tor Browser Portable version. I chose ChromePlus because the other project is in german, uses a custom launcher and is not configurable like ChromePlus. For instance in the official Tor Browser release the portable Firefox is configured to automatically start in "Private" mode. ChromePlus has additional features that allow it to be configured to start in "Incognito" mode. I liked having that option. These "private" browsing mode allow for increased security while browsing, and since this portable tor browser with chrome is all about security thats what we want!
On with the guide. The next thing you will need to do is delete the portable Firefox folder from within the Tor Browser folder. You won't need it for our purposes. After that create a folder called "Browser" inside the Tor Browser folder. This is where we will put the contents of the ChromePlus zip file. After you have extracted the contents of the ChromePlus zip file into the Browser folder there are only two more things you need to do.
The next thing to do is edit the vidalia.conf file. This is the file that launches the browser exe. You will find it in Tor Browser->Data->Vidalia->Vidalia.conf. Under [General] remove the first line that talks about the browser path. Just delete it. On the second line you should see
BrowserExecutable=blahblahblah
change that to
BrowserExecutable=.\\Browser\\chrome.exe
Save the file and lets move on.
The last thing you need to do is configure ChromePlus to use Tor and it associated stuff as a proxy to the internet. In ChromePlus click on the wrench in the upper right hand corner and select "Enhanced Options." This is the awesome "more options" that ChromePlus gives compared to Google Chrome. Under the left side bar click Startup Options and check the "Use the proxy(ip+port) option and put 127.0.0.1 in as the IP address and 8118 as the port. These are the default IP and port for the Tor Browser portable release. Just for your information if you didn't already know, 127.0.0.1 is the loopback address for your computer. Not some foreign website or anything.
Thats it. ChromePlus using Tor is ready to go. For increased security you can select "Startup as Incognito" options just below the proxy configuration in the enhanced options. Another level of security would be to use https instead of http for all your browsing while you are using your custom Tor Browser with Chrome. i personally set my homepage in this portable browser to Encrypted Google, and i set another tab to go to Tor Check. Obviously you can use anything you want.
Until Next time
d4v3
First thing you need to do is download the self extracting executable for Tor Browser. You can extract the contents of this package anywhere you want and use Tor Browser to browse the internet safely on any computer you can stick a USB stick in. In order to replace Firefox as the default browser for the package continue reading.
The next thing you need to do is download ChromePlus. ChromePlus is a version of Chrome that is portable and based on the open source version of Chrome called Chromium. I had basically two choices for the portable version of Chrome to incorporate into the Tor Browser Portable version. I chose ChromePlus because the other project is in german, uses a custom launcher and is not configurable like ChromePlus. For instance in the official Tor Browser release the portable Firefox is configured to automatically start in "Private" mode. ChromePlus has additional features that allow it to be configured to start in "Incognito" mode. I liked having that option. These "private" browsing mode allow for increased security while browsing, and since this portable tor browser with chrome is all about security thats what we want!
On with the guide. The next thing you will need to do is delete the portable Firefox folder from within the Tor Browser folder. You won't need it for our purposes. After that create a folder called "Browser" inside the Tor Browser folder. This is where we will put the contents of the ChromePlus zip file. After you have extracted the contents of the ChromePlus zip file into the Browser folder there are only two more things you need to do.
The next thing to do is edit the vidalia.conf file. This is the file that launches the browser exe. You will find it in Tor Browser->Data->Vidalia->Vidalia.conf. Under [General] remove the first line that talks about the browser path. Just delete it. On the second line you should see
BrowserExecutable=blahblahblah
change that to
BrowserExecutable=.\\Browser\\chrome.exe
Save the file and lets move on.
The last thing you need to do is configure ChromePlus to use Tor and it associated stuff as a proxy to the internet. In ChromePlus click on the wrench in the upper right hand corner and select "Enhanced Options." This is the awesome "more options" that ChromePlus gives compared to Google Chrome. Under the left side bar click Startup Options and check the "Use the proxy(ip+port) option and put 127.0.0.1 in as the IP address and 8118 as the port. These are the default IP and port for the Tor Browser portable release. Just for your information if you didn't already know, 127.0.0.1 is the loopback address for your computer. Not some foreign website or anything.
Thats it. ChromePlus using Tor is ready to go. For increased security you can select "Startup as Incognito" options just below the proxy configuration in the enhanced options. Another level of security would be to use https instead of http for all your browsing while you are using your custom Tor Browser with Chrome. i personally set my homepage in this portable browser to Encrypted Google, and i set another tab to go to Tor Check. Obviously you can use anything you want.
Until Next time
d4v3
Wednesday, December 01, 2010
Ruby saved the day.
require 'FileUtils'
Dir.glob("*.xml").each do f
if File.read(f) =~ /searchstring/ then
FileUtils.mv(f, "c:/destination_directory/" + f)
end
end
This code cycles through the contents of every xml file in the current directory looking for the search string then moves the files that have the string to another directory.
Dir.glob("*.xml").each do f
if File.read(f) =~ /searchstring/ then
FileUtils.mv(f, "c:/destination_directory/" + f)
end
end
This code cycles through the contents of every xml file in the current directory looking for the search string then moves the files that have the string to another directory.
Ruby in Windows Path syntax
basedir = "c:/test"
Notice the / and not \
duh
*smacks head*
Notice the / and not \
duh
*smacks head*
Subscribe to:
Posts (Atom)