Central Europe Information Central Europe Information » »

Tytuł:
The Rantings and Ravings of a Madman
The Rantings and Ravings of a Madman
WWW:
http://sirlagz.net
Advertisements

The Rantings and Ravings of a Madman

The Rantings and Ravings of a Madman My blog about tech games and linux. Active Directory HP CA Infrastructure Tools Android General Javascript Linux Tutorials Projects Raspberry Pi 2 nd Android App Published Android No Responses Nov 212013 Ive just published my second Android App Again for Perth Drivers this time its a simple list of todays multanova locations At the moment its very simple but Im planning on building more features as I go along. It updates daily from the WA Police website and allows you to touch the location to search it on Google Maps. You can get it from the play store Hopefully I can get some feed back from users of this app Related Posts Update to Perth Traffic Updates Plus Use An Android Phone As An IP Camera Printing from your Android device using Print Bot How To Change Telstra HTC Desire Boot Screen How To Change Your HTC Desires Splash Screen Ive just published my second Android App Again for Perth Drivers this time its a simple list of todays multanova locations At the moment its very simple but Im. . Posted by Sir Lagz at 2 15 pm Tagged with Android Android Application Perth Speed Camera Locations Perth Traffic Perth Traffic Snippet Renaming Models in CA Spectrum HP CA Infrastructure Tools Linux No Responses Nov 142013 I wanted to rename a whole bunch of models to transform their names into all lowercase with just the hostname rather than the FQDN. I used this script to do it with bash and vnmsh. The script will loop through all models found by the query with a model type handle and then renames then with a vnmsh update command. bin bash export CLIMNAMEWIDTH 70 Old IFS IFS IFS n WORKPATH opt CA Spectrum vnmsh WORKPATH connect Pingable MDLLIST WORKPATH show models mth 0 x10290 MDLLIST echo MDLLIST grep vi mname for x in MDLLIST do MDLHANDLE echo x awk F . print 1 MDLNAME echo x awk F . print tolower( 2) echo MDLHANDLE echo MDLNAME WORKPATH update mh MDLHANDLE attr 0 x1006 e val MDLNAME done WORKPATH disconnect IFS Old IFS Related Posts Quickie Script Ping Checker with email Script Starting hostapd when Wi Fi goes down Script Wi Fi Checker Script CA e Health Mass Disable Fast Polling CA Network Configuration Manager Configuration Backup Issues I wanted to rename a whole bunch of models to transform their names into all lowercase with just the hostname rather than the FQDN.
Advertisements


I used this script to do. Posted by Sir Lagz at 4 29 pm Tagged with Bash CA Shell Script vnmsh Snippet Whiptail File Browser Linux No Responses Nov 082013 I was adding some new features on Pi Parted recently and needed a simple file browser for my Pi Parted script. I couldnt find anything online for this sort of thing so I built my own file browser of sorts. Using whiptail and the output of ls (which isnt recommended but Ill get around to posting an updated version of this script sometime) I managed to get a simple file browser to allow a user to pick a file. Ill paste bits and pieces of the code to explain it and then paste the whole function at the end of this post. This starts off with an if statement to check to see whether a path has been passed to the script. If it hasnt it will start the listing off at Otherwise it will start at the path it had been passed. Function Filebrowser() if z 1 then imgpath (ls lhp awk F print 9 5 ) else imgpath (ls lhp 1 awk F print 9 5 ) fi Next still checking to see whether it was passed a path it will show a back button if it was passed a path. If z 1 then pathselect (whiptail menu Select Image File 40 50 30 cancel button Cancel ok button Select imgpath 31 12 23) else pathselect (whiptail menu Select Image File 40 50 30 cancel button Cancel ok button Select. BACK imgpath 31 12 23) fi Next it checks the return value to make sure it was 0 to signify the user didnt press cancel After that it checks the path the user selected to see if it was a directory if it is then it re runs the function and passes a path Otherwise it will determine whether the file selected is the file type that is required and if it is show that it is about to perform an action.

If its not the type required present an error to the user. RET if RET eq 0 then if d 1 pathselect then Filebrowser 1 pathselect elif f 1 pathselect then fileout file 1 pathselect filename readlink m 1 pathselect if fileout x86 boot sector then whiptail yesno title WARNING About to try and automatically resize filename. Are you sure 10 50 This bit of the code would be what you want to do after the user has selected the right type of file. If ne 0 then Filebrowser fi else whiptail msgbox title ERROR ERROR ERROR Selected file is not an image file. 8 44 Filebrowser fi And lastly check to make sure the path that was passed to the script is valid. At the moment I dont imagine this script would handle spaces well so you may see this error message when processing directories with spaces in their names. Else echo pathselect 1 pathselect whiptail title ERROR msgbox Error setting path to image file. 8 44 unset base unset imgpath Filebrowser fi exit 0 And as promised the whole code in one big block Filebrowser() if z 1 then imgpath (ls lhp awk F print 9 5 ) else imgpath (ls lhp 1 awk F print 9 5 ) fi if z 1 then pathselect (whiptail menu Select Image File 40 50 30 cancel button Cancel ok button Select imgpath 31 12 23) else pathselect (whiptail menu Select Image File 40 50 30 cancel button Cancel ok button Select. BACK imgpath 31 12 23) fi RET if RET eq 1 then This is the section where you control what happens when the user hits Cancel Advanced Menu exit 0 elif RET eq 0 then if d 1 pathselect then Filebrowser 1 pathselect elif f 1 pathselect then Do your thing here this is just a stub of the code I had to do what I wanted the script to do. Fileout file 1 pathselect filename readlink m 1 pathselect if fileout x86 boot sector then whiptail yesno title WARNING About to try and automatically resize filename.

Are you sure 10 50 if ne 0 then Filebrowser fi else whiptail msgbox title ERROR ERROR ERROR Selected file is not an image file. 8 44 Filebrowser fi else echo pathselect 1 pathselect whiptail title ERROR msgbox Error setting path to image file. 8 44 unset base unset imgpath Filebrowser fi exit 0 fi Related Posts How To Customise GParted Live CD Pi Parted v0. 04 Pi Parted v0. 03 Pi Parted v0. 02 Pi Parted I was adding some new features on Pi Parted recently and needed a simple file browser for my Pi Parted script. I couldnt find anything online for this sort of thing so. Posted by Sir Lagz at 10 22 pm Tagged with Bash Script file browser Pi Parted Shell Script whiptail What Is Wrong With Linux Users Today LOL 5 Responses Oct 122013 I had this conversation on IRC last night. 23 01 Bushmaster hi 23 01 Bushmaster seeking some help 23 02 Bushmaster my pclinuxos during synpatic update got hanged 23 02 Bushmaster and now i cannot boot it up 23 02 Bushmaster it says lnusertemp directory full 23 02 Bushmaster what it means 23 03 Sir Lagz Bushmaster it means that the directory lnusertemp is full. 23 04 Bushmaster what i can do about it 23 04 Sir Lagz Bushmaster empty out that directory 23 05 Bushmaster u playing ball game with me dawg or u know things 23 05 Sir Lagz Bushmaster are you talking to me 23 05 Bushmaster no u not worth it 23 06 Sir Lagz righto then.

23 06 Bushmaster i need someone who is helpful and not moron 23 07 Sir Lagz Bushmaster seriously PCLinux OS is telling you a directory is full. What would you do with a directory that is full 23 07 Bushmaster leave it dawg Is it just meor can people just not read nowadays I had this conversation on IRC last night. 23 01 Bushmaster hi 23 01 Bushmaster seeking some help 23 02 Bushmaster my pclinuxos during synpatic update got hanged 23 02 . Posted by Sir Lagz at 2 52 pm How To Captive Portal On The Raspberry Pi Raspberry Pi Tutorials 8 Responses Aug 232013 After making an Access Point out of a Raspberry Pi I decided to see what else I could do with it. One of the things I had noticed on the forums was a captive portal function. When someone connects to the Access Point no matter where they point their web browser it will always direct them to the page hosted on the Pi. In order to do that well need to install a web server on the Pi to host the page. Ive used lighttpd for this setup so its a simple apt get install lighttpd The default directory for lighttpd is var www so you can place your splash page in there. Once lighttpd is installed we need to make a slight change to the dnsmasq configuration. Add the extra line below into etc dnsmasq.

Conf replace 10. 0. 1 with the IP address of the AP if you have not followed the guide above. Address 10. 1 Once the file has been updated restart dnsmasq etc init. D dnsmasq restart Now whenever someone connects to the access point and points their web browser to anything it will be directed to the splash page that you have created Related Posts How To Use A RT5370 USB Wi Fi NIC In A Bridge How To Use The Raspberry Pi As A Wireless Access Point Router Part 3B Rasp AP Web GUI Quickie Feedback on the Wi Fi Pi Configuration Portal How To Use The Raspberry Pi As A Wireless Access Point Router Part 3A After making an Access Point out of a Raspberry Pi I decided to see what else I could do with it. One of the things I had noticed on the. Posted by Sir Lagz at 3 36 am Tagged with Captive Portal Honeypot Rasp AP Wi Fi Snippet BASH Script To Create Directories Per File Linux No Responses Aug 182013 I recently had to create a whole bunch of directories for my XBMC HTPC so that it could parse the directory contents correctly so I made a little script to help me do it This script takes a file extension as an argument and then creates directories for all the files that have that extension. The directory name is the same as the original file name minus the extension. Example Usage .

convert. Sh avi The example will get all avi files in the current directory and create directories for the files and then move the files into those directories. bin bash Old IFS IFS IFS n shopt s nullglob for x in . 1 do mkdir x 0 ( 4) mv x x 0 ( 4) done IFS Old IFS Related Posts How To Do Automatic Console Sharing On The Raspberry Pi How To Use Screen To Give You Multiple Terminal Windows I recently had to create a whole bunch of directories for my XBMC HTPC so that it could parse the directory contents correctly so I made a little script to. Posted by Sir Lagz at 3 18 pm Tagged with Bash Script directory Shell Raspbian Server Edition Scripts Linux Projects Raspberry Pi 6 Responses Aug 032013 A few people have asked for the scripts that I use to generate Raspbian Server Edition. So here they are The package list is just a dump from dpkg of all the packages that have been removed. The script is a very rough script so theres no error checking. The syntax is pkgs. Sh pkgs. Txt Related Posts Raspbian Server Hard Drive Edition 2.

4 Raspbian Server Edition 2. 4 Raspbian Server Edition Version 2. 3 1 GB Image Raspbian Server Edition Version 2. 3 Quickie Getting Motion Working on the Raspberry Pi A few people have asked for the scripts that I use to generate Raspbian Server Edition. So here they are The package list is just a dump from dpkg. Posted by Sir Lagz at 11 38 pm Tagged with Raspbian Raspbian Server Edition RSE Snippet Javascript Hours and Minutes From Seconds Javascript No Responses Jul 222013 Just a quick snippet of code to convert seconds to hours minutes and seconds with the hours shown optionally. Function from Seconds(seconds show Hours false) if(show Hours) var hours Math. Floor(seconds 3600) seconds seconds hours 3600 var minutes (Math. Floor(seconds 60) 10) 0 Math. Floor(seconds 60) Math.

Floor(seconds 60) var seconds (seconds 60 9) seconds 60 0 seconds 60 if(show Hours) var timestring hours minutes seconds else var timestring minutes seconds return timestring Related Posts Read Email Subjects From Outlook Using JScript Connecting to SQL Server with Javascript Active Directory With Javascript Using SQL Dialect to Query AD Active Directory With JScript How to Search for Users Active Directory With Javascript How to Get All The Domain Controllers in Your Domain Just a quick snippet of code to convert seconds to hours minutes and seconds with the hours shown optionally. Function from Seconds(seconds show Hours false) if(show Hours) var hours . Posted by Sir Lagz at 10 56 am Tagged with from seconds Javascript time VMware ESXi 5. 1 And My Nvidia MCP61 Motherboard Tutorials VMWare 2 Responses Jul 192013 So Ive recently started dabbling in the fun world of virtalisation and wanted to use my spare computer as a VMWare ESXi host. Unfortunately the NIC in it was unsupported however the driver that supports the NIC was present in ESXi. So with a bit of trickery I got the installation media recognising my n Vidia NIC as a supported device. This can theoretically be done with any NIC that is supported by the forcedeth driver. Make sure that your NIC uses the same numbers as mine otherwise youll need to change the numbers that you paste later in this post. To check run this command and you should get something similar back. lspci nn grep i ethernet 00 07.

0 Bridge 0680 NVIDIA Corporation MCP61 Ethernet 10 de 03 ef (rev a2) Those numbers in the square brackets at the end are the ones we need. First thing I had to do was grab the VMWare iso and mount it so I could copy all the files off. mkdir installfiles mount o loop VMware VMvisor Installer 5. 1. Update01 1065491. X86 64. Iso isofile cp r isofile installfiles Once all the files were copied off we need to use the vmtar utility to modify the files. The only way that I have found of getting the vmtar utility was to have esxi already installed and copy vmtar from that. Once I got the vmtar utility I could modify the net forc. V00 archive that contains the forcedeth driver details.

Well need to extract the files first vmtar x net forc. V00 o net forc. Tar tar xvf net forc. Tar Once theyre extracted youll see 2 directories etc and usr. In usr share hwdata driver. Pciids. D theres a file called forcedeth. Ids Open that up and add this line and save the file. 03 ef n Vidia NForce Network Controller Next file is in etc vmware driver. Map.

D and called forcedeth. Map Modify that one by adding in this line and save the file regtype linux bus pci id 10 de 03 ef 0000 0000 driver forcedeth class network Once those 2 files are modified package up the files again tar cvf net forc. Tar vmtar c net forc. Tar o net forc. V00 Next step is to package it back up into an iso file. mkisofs relaxed filenames J R o custom esxi. Iso b isolinux. Bin c boot. Cat no emul boot boot load size 4 boot info table installfiles This command will take all the files in installfiles and re package them into an ISO. Once thats done you should be able to boot off the ISO and use the MCP61 NIC on vm Ware So Ive recently started dabbling in the fun world of virtalisation and wanted to use my spare computer as a VMWare ESXi host.

Unfortunately the NIC in it was unsupported . Posted by Sir Lagz at 7 28 pm Tagged with forcedeth mcp nforce vmware Raspbian Server Edition 2. 5 Linux Projects Raspberry Pi 15 Responses Jul 192013 Hey Everyone. This version of Raspbian Server Edition is just 2. 4 but its been upgraded to Jessie rather than Wheezy. Not much has changed apart from that but itll save you an update 5431 be436 a23 fd05 e779 f3 a14 e8 fe05 d5 a9 dc581 RSE2. 5. Img 4 cbb92 b1 b7700 dff3 eab95581 c3 b043 a1 ccaee1 f 1 GB RSE2. Img The images can be grabbed from here RSE 2. 5 RSE 2.

5 1 GB Hey Everyone. Not much has changed apart from that but itll save. Posted by Sir Lagz at 12 08 am Tagged with Raspbian Raspbian Server Edition RSE Older Entries Affiliate Links Part Sim Circuit Simulation Made Easy Check it out here Pages Contact Me Active Directory with Javascript Examples Follow Me Help Keep This Site Up As we all know hosting costs money. You can help me keep this site up and running by pressing on the button below ) My Tweets Metalinks Log in Entries RSS Comments RSS Word Press. Org Recent Posts 2 nd Android App Published Snippet Renaming Models in CA Spectrum Snippet Whiptail File Browser What Is Wrong With Linux Users Today How To Captive Portal On The Raspberry Pi Archive November 2013(3) October 2013(1) August 2013(3) July 2013(3) June 2013(4) May 2013(2) April 2013(4) March 2013(7) February 2013(9) January 2013(9) December 2012(3) November 2012(1) October 2012(4) September 2012(2) August 2012(16) July 2012(12) June 2012(10) May 2012(2) April 2012(6) March 2012(2) January 2012(2) December 2011(2) October 2011(4) July 2011(4) June 2011(4) May 2011(21) April 2011(13) January 2011(2) December 2010(6) Tags Active Directory Active X AD Android Bash Bash Script Bash Scripting CA Case Debian Email Feedback ffmpeg Games Gaming GParted hostapd HTC Desire Humble Frozenbyte Bundle Humble Indie Bundle Image Image File Javascript JScript Linux Motion Netboot Pi Parted PXE PXELINUX Raspberry Pi Raspbian Raspbian Server Edition Ras Pi Rpi RSE Script Shell Shell Script Spectrum WAP Webcam Wi Fi Wi Fi Access Point Wireless Access Point 2011 The Rantings and Ravings of a Madman Suffusion theme by Sayontan Sinha. Kontakt. .

Ocena: 4.30/5 Głosów: 12

Contact: admin@centraleuropeaninformation.com