Difference between revisions of "User talk:Rael"
m (→To Thumbs) |
m (→Tillad Sudo uden password) |
||
(43 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
---- | ---- | ||
'''Nmap Hackers'''<br/> | '''Nmap Hackers'''<br/> | ||
− | <rss>http://seclists.org/rss/nmap-hackers.rss|short|max=3|highlight</rss> | + | <!--<rss>http://seclists.org/rss/nmap-hackers.rss|short|max=3|highlight</rss>--> |
Noter:<br/> | Noter:<br/> | ||
Line 27: | Line 27: | ||
https://help.ubuntu.com/community/RootSudo<br/> | https://help.ubuntu.com/community/RootSudo<br/> | ||
==Her og nu husk== | ==Her og nu husk== | ||
+ | *https://plus.google.com/102038508961639166839/posts/J73jZfSBoC6 | ||
*http://download.intel.com/design/processor/datashts/324641.pdf | *http://download.intel.com/design/processor/datashts/324641.pdf | ||
+ | *https://www.soluto.com/reports | ||
+ | *http://newz.dk/google-og-cisco-verdensfoerende-i-groen-it | ||
+ | *http://askubuntu.com/questions/98844/how-do-i-get-a-tp-link-tl-wn722n-wireless-card-working | ||
+ | *http://stackoverflow.]com/questions/7566569/how-to-continuosly-monitor-the-directory-using-dnotify-inotify-command | ||
+ | *http://linux.die.net/man/1/inotifywait | ||
+ | *[http://mars.tekkom.dk/mediawiki/index.php?title=Special:UserLogin&type=signup Opret Bruger] | ||
+ | *[http://www.cisco.com/en/US/solutions/collateral/ns341/ns525/ns537/ns705/ns827/white_paper_c11-520862.html Cisco Visual Networking Index: Global Mobile Data Traffic Forecast Update, 2012–2017] | ||
+ | *[http://www.instructables.com/id/Garduino-Gardening-Arduino/ Garduino] | ||
+ | *[https://groklearning.com/challenge NSSS Challenge] | ||
+ | |||
+ | ==Rasp links== | ||
+ | *[http://www.networkinghowtos.com/howto/raspbian-on-raspberry-pi-using-sd-card-usb-memory-stick/ Boot raspberry from USB] | ||
+ | *[http://www.raspbian.org/RaspbianXBMC RaspbianXBMC] | ||
+ | *[http://sdsc-sandbox.blogspot.dk/2013/04/parallel-pong-on-raspberry-pis.html Parallel Pong on Raspberry Pis] | ||
+ | |||
=Sandkasse= | =Sandkasse= | ||
+ | ==Netværks Fun== | ||
+ | ===Loopback Script=== | ||
+ | Et lille script der laver loopback interfaces som senere kan bruges til summeringer. | ||
+ | <source lang=cli> | ||
+ | for(var i = 1; i<100;i++) | ||
+ | { | ||
+ | $("#content").append("int lo "+i+"<br />"); | ||
+ | $("#content").append("ipv add 2001:db8:01"+pad(i, 2)+"::1/128<br />"); | ||
+ | $("#content").append("ipv ospf 1 a 1<br />"); | ||
+ | $("#content").append("!<br />"); | ||
+ | } | ||
+ | |||
+ | function pad(num, size) { | ||
+ | var s = num+""; | ||
+ | while (s.length < size) s = "0" + s; | ||
+ | return s; | ||
+ | } | ||
+ | </source> | ||
+ | [http://jsfiddle.net/Cq3Ts/1/ Fiddle Link] | ||
+ | ==Vis hukommelse på Windows Computer== | ||
+ | <pre>wmic MEMORYCHIP get banklabel, devicelocator, caption, capacity</pre> | ||
+ | ==Fjern tomme foldere på linux== | ||
+ | <pre> | ||
+ | #remove empty directories from this dir that isnt modifies within the last 60 min. | ||
+ | find . -maxdepth 1 -mmin +60 -type d -empty -exec rmdir {} \; | ||
+ | # move alle directories staring with 45 not modified within the last 20 houts(1200min) to 130217 | ||
+ | find 45* -type d -mmin +1200 -exec mv {} 130217 \; | ||
+ | </pre> | ||
==Definition Lists== | ==Definition Lists== | ||
http://www.mediawiki.org/wiki/Help:Formatting | http://www.mediawiki.org/wiki/Help:Formatting | ||
Line 47: | Line 91: | ||
{{TOCright}} | {{TOCright}} | ||
</pre> | </pre> | ||
+ | ==Source CLI== | ||
+ | <pre> | ||
+ | {{Source cli}} | ||
+ | </pre> | ||
+ | |||
==In Progress== | ==In Progress== | ||
<pre> | <pre> | ||
Line 52: | Line 101: | ||
</pre> | </pre> | ||
==Section include== | ==Section include== | ||
+ | <pre>{{:Article}}</pre> | ||
+ | |||
==Ubuntu 11.xx fix== | ==Ubuntu 11.xx fix== | ||
Hvis systemet ikke kommer med en login prompt efter instllation/upgradering | Hvis systemet ikke kommer med en login prompt efter instllation/upgradering | ||
Line 65: | Line 116: | ||
==Copy Pub key to server== | ==Copy Pub key to server== | ||
<pre> | <pre> | ||
− | cat id_rsa.pub | ssh git.tekkom.dk "cat >> .ssh/authorized_keys" | + | cat .ssh/id_rsa.pub | ssh git.tekkom.dk "cat >> .ssh/authorized_keys" |
</pre> | </pre> | ||
+ | ==Ændre tidszonen== | ||
+ | <pre> | ||
+ | dpkg-reconfigure tzdata | ||
+ | </pre> | ||
+ | |||
+ | ==Apache log analyzer== | ||
+ | <source lang=bash> | ||
+ | zcat access.log.*.gz | cut -d' ' -f1 | sort | uniq -c | sort -h -r -b | head -n 50 | while read cnt ip; do echo -ne "$cnt\t"; echo -ne "$ip "; echo -e "(`dig -x $ip | grep PTR | grep -v -E '^;' | tr ' \t' ' '|cut -d' ' -f5`)"; echo -e "`whois $ip| grep address | head -n1 | sed -e 's/^address:*/\t/'`"; done | ||
+ | </source> | ||
+ | |||
==Convert Images on Linux== | ==Convert Images on Linux== | ||
===To Thumbs=== | ===To Thumbs=== | ||
Line 73: | Line 134: | ||
for i in *.JPG; do djpeg $i | pnmscale -width 800 | cjpeg -opti -progr -qual 90 > TN_$i; echo $i processed; done | for i in *.JPG; do djpeg $i | pnmscale -width 800 | cjpeg -opti -progr -qual 90 > TN_$i; echo $i processed; done | ||
</source> | </source> | ||
+ | Brug convert istedet den bevarer EXIF | ||
+ | <source lang=bash> | ||
+ | for i in *.JPG; do convert -resize 800 -quality 90 $i TN_$i; echo $i processed; done | ||
+ | </source> | ||
+ | Kør din konvertering parallelt: | ||
+ | <source lang=cli> | ||
+ | ls -1 *.jpg | parallel -j 5 --eta convert -resize 800 -quality 90 '{}' 'TN_{.}.jpg' | ||
+ | #Eksempel fra MAC'en | ||
+ | Dafs-MacBook-Air:101CANON rael$ sudo port install parallel | ||
+ | Dafs-MacBook-Air:101CANON rael$ ls -1 *.JPG | parallel -j 5 --eta convert -resize 800 -quality 90 '{}' 'thumb/TN_{.}.jpg' | ||
+ | |||
+ | Computers / CPU cores / Max jobs to run | ||
+ | 1:local / 4 / 5 | ||
+ | |||
+ | Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete | ||
+ | ETA: 1688s 2210left 0.76avg local:5/88/100%/0.8s | ||
+ | </source> | ||
+ | Time comparision(on the Raspberry PI): | ||
+ | <source lang=bash> | ||
+ | # time djpeg DSCN1111.JPG | pnmscale -width 800 | cjpeg -opti -progr -qual 90 > TN_DSCN1111.JPG | ||
+ | |||
+ | real 0m37.604s | ||
+ | user 0m25.870s | ||
+ | sys 0m1.750s | ||
+ | |||
+ | # time convert -resize 800 -quality 90 DSCN1111.JPG TN2_DSCN1111.JPG | ||
+ | |||
+ | real 5m9.545s | ||
+ | user 2m19.830s | ||
+ | sys 0m8.250s | ||
+ | </source> | ||
+ | Time comparision(I386): | ||
<source lang=bash> | <source lang=bash> | ||
− | for i in *.JPG; do | + | # time djpeg IMG_0722.JPG | pnmscale -width 800 | cjpeg -opti -progr -qual 90 > TN_IMG_0722.JPG |
+ | |||
+ | real 0m0.916s | ||
+ | user 0m1.108s | ||
+ | sys 0m0.092s | ||
+ | |||
+ | # time convert -resize 800 -quality 90 IMG_0722.JPG TN2_IMG_0722.JPG | ||
+ | |||
+ | real 0m2.536s | ||
+ | user 0m2.844s | ||
+ | sys 0m0.132s | ||
+ | </source> | ||
+ | Hvis den skal tælle op kan man bruge denne for løkke. | ||
+ | <source lang=bash> | ||
+ | t=1; w=`ls -l | wc -l`; for i in *.JPG; do let t++ ; echo "Converted $i($t/$w)"; done | ||
</source> | </source> | ||
Line 83: | Line 190: | ||
for i in *.bmp; do convert $i $(basename $i bmp)jpg ; echo "Converted $i"; done | for i in *.bmp; do convert $i $(basename $i bmp)jpg ; echo "Converted $i"; done | ||
</source> | </source> | ||
+ | |||
+ | ==Configure Ubuntu to send mail on logon== | ||
+ | <source lang=cli> | ||
+ | aptitude install sendemail -y # Ja det er sendemail og ikke sendmail | ||
+ | echo "echo besked" | sendemail -f mailaddr@mydomain.local -t bruger@domain.local -u subject -s smtp.maildomain.local | ||
+ | </source> | ||
+ | Tilføj en linie i bunden af /etc/profile. Denne fil bliver kørt hver gang en bruger logger ind. | ||
+ | <source lang=cli> | ||
+ | echo -e "$USER er loggint ind, her er de øvrige brugere: \n `who`" | sendemail -f mailaddr@mydomain.local -t bruger@domain.local -u subject -s smtp.maildomain.local | ||
+ | </source> | ||
+ | ==Fix ubuntu perl Language problem== | ||
+ | <source lang=cli> | ||
+ | apt-get install language-pack-en-base | ||
+ | |||
+ | |||
+ | export LANGUAGE=en_US.UTF-8 | ||
+ | export LANG=en_US.UTF-8 | ||
+ | export LC_ALL=en_US.UTF-8 | ||
+ | locale-gen en_US.UTF-8 | ||
+ | dpkg-reconfigure locales | ||
+ | </source> | ||
+ | ==IPv4 apt-get== | ||
+ | <pre> | ||
+ | apt-get -o Acquire::ForceIPv4=true install screen htop nmon -y | ||
+ | </pre> | ||
+ | |||
+ | ==Tillad Sudo uden password== | ||
+ | her får pi brugeren lov til at sudo uden password | ||
+ | nano /etc/sudoers | ||
+ | <pre> | ||
+ | pi ALL=(ALL) NOPASSWD: ALL | ||
+ | </pre> | ||
==Top Linux Tools== | ==Top Linux Tools== | ||
http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html | http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html |
Latest revision as of 14:54, 18 February 2016
Mono Project News
<rss>http://www.mono-project.com/news/index.rss2%7Cshort%7Cmax=3%7Chighlight</rss>
Cisco Security News
<rss>http://newsroom.cisco.com/data/syndication/rss2/news_at_cisco_5Security.xml%7Cshort%7Cmax=3%7Chighlight</rss>
Cuda News
<rss>http://www.nvidia.com/content/cudazone/CUDABrowser/assets/data/rss_en-us.xml%7Cshort%7Cmax=3%7Chighlight</rss>
Windows Team Blog
<rss>http://windowsteamblog.com/windows_live/b/windowslive/rss.aspx%7Cshort%7Cmax=3%7Chighlight</rss>
Nmap Hackers
Noter:
http://blinkdagger.com/matlab/matlab-tips-and-tricks-on-manipulating-1-d-arrays-vectors/
http://www.howtoforge.com/using-iscsi-on-ubuntu-9.04-initiator-and-target
https://help.ubuntu.com/community/PXEInstallMultiDistro#SYSLINUX <- til tirsdag syslinux
http://www.howtoforge.com/how-to-set-up-webdav-with-apache2-on-ubuntu-8.10
http://www.getipv6.info/index.php/Cisco_6to4_Relay_Service
http://bgp.he.net/ipv6-progress-report.cgi
http://docwiki.cisco.com/wiki/IOS_IP_SLAs_for_IPv6_White_Paper
http://www.txv6tf.org/wp-content/uploads/2010/08/McFarland-Tutorial-ent-v6-deploy.pdf
http://beginlinux.com/blog/2009/01/ssl-on-ubuntu-810-apache2/
https://help.ubuntu.com/community/RootSudo
Contents
- 1 Her og nu husk
- 2 Rasp links
- 3 Sandkasse
- 3.1 Netværks Fun
- 3.2 Vis hukommelse på Windows Computer
- 3.3 Fjern tomme foldere på linux
- 3.4 Definition Lists
- 3.5 TOC Right
- 3.6 Source CLI
- 3.7 In Progress
- 3.8 Section include
- 3.9 Ubuntu 11.xx fix
- 3.10 Show Cron Jobs
- 3.11 Copy Pub key to server
- 3.12 Ændre tidszonen
- 3.13 Apache log analyzer
- 3.14 Convert Images on Linux
- 3.15 Configure Ubuntu to send mail on logon
- 3.16 Fix ubuntu perl Language problem
- 3.17 IPv4 apt-get
- 3.18 Tillad Sudo uden password
- 3.19 Top Linux Tools
Her og nu husk
- https://plus.google.com/102038508961639166839/posts/J73jZfSBoC6
- http://download.intel.com/design/processor/datashts/324641.pdf
- https://www.soluto.com/reports
- http://newz.dk/google-og-cisco-verdensfoerende-i-groen-it
- http://askubuntu.com/questions/98844/how-do-i-get-a-tp-link-tl-wn722n-wireless-card-working
- http://stackoverflow.]com/questions/7566569/how-to-continuosly-monitor-the-directory-using-dnotify-inotify-command
- http://linux.die.net/man/1/inotifywait
- Opret Bruger
- Cisco Visual Networking Index: Global Mobile Data Traffic Forecast Update, 2012–2017
- Garduino
- NSSS Challenge
Rasp links
Sandkasse
Netværks Fun
Loopback Script
Et lille script der laver loopback interfaces som senere kan bruges til summeringer.
for(var i = 1; i<100;i++)
{
$("#content").append("int lo "+i+"<br />");
$("#content").append("ipv add 2001:db8:01"+pad(i, 2)+"::1/128<br />");
$("#content").append("ipv ospf 1 a 1<br />");
$("#content").append("!<br />");
}
function pad(num, size) {
var s = num+"";
while (s.length < size) s = "0" + s;
return s;
}
Vis hukommelse på Windows Computer
wmic MEMORYCHIP get banklabel, devicelocator, caption, capacity
Fjern tomme foldere på linux
#remove empty directories from this dir that isnt modifies within the last 60 min. find . -maxdepth 1 -mmin +60 -type d -empty -exec rmdir {} \; # move alle directories staring with 45 not modified within the last 20 houts(1200min) to 130217 find 45* -type d -mmin +1200 -exec mv {} 130217 \;
Definition Lists
http://www.mediawiki.org/wiki/Help:Formatting
;item 1 : definition 1 ;item 2 : definition 2-1 : definition 2-2
- item 1
- definition 1
- item 2
- definition 2-1
- definition 2-2
TOC Right
{{TOCright}}
Source CLI
{{Source cli}}
In Progress
{{In progress}}
Section include
{{:Article}}
Ubuntu 11.xx fix
Hvis systemet ikke kommer med en login prompt efter instllation/upgradering
- alt+højre pil
- slette splash fra /etc/default/grub
- update-grub
Show Cron Jobs
This is how to show cron jobs from all users
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
Copy Pub key to server
cat .ssh/id_rsa.pub | ssh git.tekkom.dk "cat >> .ssh/authorized_keys"
Ændre tidszonen
dpkg-reconfigure tzdata
Apache log analyzer
zcat access.log.*.gz | cut -d' ' -f1 | sort | uniq -c | sort -h -r -b | head -n 50 | while read cnt ip; do echo -ne "$cnt\t"; echo -ne "$ip "; echo -e "(`dig -x $ip | grep PTR | grep -v -E '^;' | tr ' \t' ' '|cut -d' ' -f5`)"; echo -e "`whois $ip| grep address | head -n1 | sed -e 's/^address:*/\t/'`"; done
Convert Images on Linux
To Thumbs
Alt dette piping sletter EXIF data
for i in *.JPG; do djpeg $i | pnmscale -width 800 | cjpeg -opti -progr -qual 90 > TN_$i; echo $i processed; done
Brug convert istedet den bevarer EXIF
for i in *.JPG; do convert -resize 800 -quality 90 $i TN_$i; echo $i processed; done
Kør din konvertering parallelt:
ls -1 *.jpg | parallel -j 5 --eta convert -resize 800 -quality 90 '{}' 'TN_{.}.jpg'
#Eksempel fra MAC'en
Dafs-MacBook-Air:101CANON rael$ sudo port install parallel
Dafs-MacBook-Air:101CANON rael$ ls -1 *.JPG | parallel -j 5 --eta convert -resize 800 -quality 90 '{}' 'thumb/TN_{.}.jpg'
Computers / CPU cores / Max jobs to run
1:local / 4 / 5
Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete
ETA: 1688s 2210left 0.76avg local:5/88/100%/0.8s
Time comparision(on the Raspberry PI):
# time djpeg DSCN1111.JPG | pnmscale -width 800 | cjpeg -opti -progr -qual 90 > TN_DSCN1111.JPG
real 0m37.604s
user 0m25.870s
sys 0m1.750s
# time convert -resize 800 -quality 90 DSCN1111.JPG TN2_DSCN1111.JPG
real 5m9.545s
user 2m19.830s
sys 0m8.250s
Time comparision(I386):
# time djpeg IMG_0722.JPG | pnmscale -width 800 | cjpeg -opti -progr -qual 90 > TN_IMG_0722.JPG
real 0m0.916s
user 0m1.108s
sys 0m0.092s
# time convert -resize 800 -quality 90 IMG_0722.JPG TN2_IMG_0722.JPG
real 0m2.536s
user 0m2.844s
sys 0m0.132s
Hvis den skal tælle op kan man bruge denne for løkke.
t=1; w=`ls -l | wc -l`; for i in *.JPG; do let t++ ; echo "Converted $i($t/$w)"; done
From BMP to JPG
for i in *.bmp; do convert $i $(basename $i bmp)jpg ; echo "Converted $i"; done
Configure Ubuntu to send mail on logon
aptitude install sendemail -y # Ja det er sendemail og ikke sendmail
echo "echo besked" | sendemail -f mailaddr@mydomain.local -t bruger@domain.local -u subject -s smtp.maildomain.local
Tilføj en linie i bunden af /etc/profile. Denne fil bliver kørt hver gang en bruger logger ind.
echo -e "$USER er loggint ind, her er de øvrige brugere: \n `who`" | sendemail -f mailaddr@mydomain.local -t bruger@domain.local -u subject -s smtp.maildomain.local
Fix ubuntu perl Language problem
apt-get install language-pack-en-base
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales
IPv4 apt-get
apt-get -o Acquire::ForceIPv4=true install screen htop nmon -y
Tillad Sudo uden password
her får pi brugeren lov til at sudo uden password nano /etc/sudoers
pi ALL=(ALL) NOPASSWD: ALL
Top Linux Tools
http://www.cyberciti.biz/tips/top-linux-monitoring-tools.html