In order to be able to download images from the internet,
-
add the below lines:
export http_proxy=http://proxy:8080
export https_proxy=http://proxy:8080
export no_proxy=*.lan
In order to be able to download images from the internet,
add the below lines:
export http_proxy=http://proxy:8080
export https_proxy=http://proxy:8080
export no_proxy=*.lan
python -m SimpleHTTPServer |
# Add the below in the VirtualHost section (in apache2.conf of the sites-enabled/* file): | |
<Location /> | |
Deny from all | |
AuthUserFile /usr/local/etc/httpd/users | |
AuthName authorization | |
AuthType Basic | |
Satisfy Any | |
require valid-user | |
</Location> |
# 1) get line number of first relevant log line: (e.g. by date 2014-01-13 13:49) | |
grep "2014-01-13 13:49" original.log -n | more | |
# 2) get line number of last relevant log line: (e.g. by date 2014-01-13 16:36) | |
grep "2014-01-13 16:36" original.log -n | more | |
# 3) the total number of lines from the original log file: | |
wc -l original.log -n | |
# e.g. results of 1-3: |
find . -iname \*.sh | xargs chmod +x |
# find all XML files from current directory (including its subdirectories recursively) by content 'sonar' | |
find . -name '*.xml' -print0 | xargs -0 grep 'sonar' |
# Example command for checking how long a Java process was running (etime = elapsed time) | |
ps -eo pid,comm,cmd,start,etime | grep java | |
# It will return something like: | |
# 21443 java /opt/jdk8/bin/java -Djava.u Feb 25 3-12:46:12 | |
# and this means an uptime of 3 Days, 12 Hours, 46 Minutes and 12 Seconds | |
# More alternatives & explanations here: http://linuxcommando.blogspot.ro/2008/09/how-to-get-process-start-date-and-time.html |
# 1. First make sure you copied the Gerrit commit-msg hook (from Gerrit to your local repos .git/hooks folder) | |
# 2. Make the code changes needed and then stage them using the usual command | |
git add . -A | |
# 3. Now commit them using amend and notice that the previous commit message is used but is suffixed with the Change-Id of your previous commit. Make sure you leave that (even if you modify the commit message). Note: modifying the commit message will overwrite the previous one. | |
git commit --amend | |
# 4. push your changes for review: | |
git push origin HEAD:refs/for/master |
# below example is a shell script which logs the number of connections every 30 seconds | |
#!/bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "Please provide the port number for which you want to monitor the connection count as the one and only argument!" | |
exit | |
fi | |
while true; do | |
crtDate=`date` |
# jmap is in $JAVA_HOME/bin/ (assumed in your path, but you can use the complete path if it's not) | |
jmap -dump:format=b,file=heap_dump.hprof <process ID> |