The %~dp0 Variable « Miscellaneous IT Pimpery The %~dp0 (that’s a zero) variable when referenced within a Windows batch file will expand to the drive letter and path of that batch file. The variables %0-%9 refer to the command line parameters of the batch file. %1-%9 refer to command line arguments after the batch file name. %0 refers to the batch file itself. If you follow the percent character (%) with a tilde character (~), you can insert a modifier(s) before the parameter number to alter the way the variable is expanded. The d modifier expands to the drive letter and the p modifier expands to the path of the parameter. Example: Let’s say you have a directory on C: called bat_files, and in that directory is a file called example.bat. In this case, %~dp0 (combining the d and p modifiers) will expand to C:\bat_files\. Check out this Microsoft article for a full explanation. Also, check out this forum thread.
Tshark examples: howto capture and dissect network traffic - Vimperator This page contains a collection of useful examples for using tshark, the network traffic capture and analysis tool. Network Traffic Capture tshark can be used to dump network traffic into capture files for later processing. tshark -f "udp port 1812" -i eth0 -w /tmp/capture.cap The -f flag is used to specify a network capture filter (more on filters later). Network capture rules Network capture rules or filters, specified by the -f option allows you to tell tshark which packets should be captured. Packet display rules Packet display rules or filters as their name imply, allow you to control which packets are displayed by tshark when performing live network capture or when tshark is reading a capture file. tshark -R "ip.addr == 192.168.0.1" -r /tmp/capture.cap This example displays only IP packets that are issued by or in destination to the IP address 192.168.0.1. The filter expression can be a logical combination of other filter expressions. Network Traffic Dissection
Learn Linux, 101: A roadmap for LPIC-1 About this series This series of articles helps you learn Linux system administration tasks. The topics mirror those of the Linux Professional Institute Certification (LPIC) level 1 (LPIC-1) exams. You can use the articles to prepare for certification, or just to learn about Linux. There are two exams for LPIC-1 certification: exam 101 and exam 102, and you must pass both to attain LPIC-1 certification. Each exam has several topics, and each topic has several objectives. The material in these articles corresponds to the April 2009 objectives for exam 101 and exam 102 You should always refer to the objectives for the definitive requirements. This roadmap is in progress; as we complete articles, we add them to the roadmap. Note: New material will be added over the coming months as it becomes available. Exam 101 Exam 101 - Topic 101: System architecture Where are the articles? Back to top Exam 101 - Topic 102: Linux installation and package management Exam 101 - Topic 103: GNU and UNIX commands
Civic Networks: Building Community On the Net - An Article by Scott London All sorts of reasons have been advanced in recent years to explain the decline of community in America, including the way we design our neighborhoods, the increased mobility of the average American, and demographic shifts like the movement of women into the labor force. But the onslaught of television and other electronic technologies is usually cited as the main culprit. As Harvard sociologist Robert Putnam puts it, these technologies are increasingly "privatizing our leisure time" and "undermining our connections with one another and with our communities." This essay appears in the book Composing Knowledge, edited by Rolf Norgaard (Bedford/St. In his essay "The Strange Disappearance of Civic America," Putnam draws a direct parallel between the arrival of television and the decline of what he calls "social capital" — the social networks, trust, and norms of reciprocity that are the essence of healthy communities. Virtual Community The Networked Community Public Space Deliberation
Silly batch file tricks, redirecting stdout into an evironment variable and %~dp0 - Loren Halvorson's Blog Some things in batch files seem like they should be so simple, but I'm embarrassed to say how long it took to come up with this little trick. Maybe YOU knew it already, but you should have posted it in your blog so I could have googled it and been done in the 10 seconds it SHOULD have taken me to solve it :-) In case you ever have wanted to take the console output of a command line tool and capture it in an environment variable, this works. There may be better ways. Thanks to Scott Colestock for helping dig this one up. setlocalsometool.exe > temp.txtset /p TOOLOUTPUT= < temp.txtdel temp.txt..do something with %TOOLOUTPUT%...endlocal Of course when Monad comes out none of this monkey business will be necessary. Since I'm on the topic of useful/(or useless?) setlocal"%~dp0sometool.exe" > temp.txtset /p TOOLOUTPUT= < temp.txtdel temp.txt..do something with %TOOLOUTPUT%...endlocal
lsof lsof is the sysadmin/security über-tool. I use it most for getting network connection related information from a system, but that’s just the beginning for this powerful and too-little-known application. The tool is aptly called lsof because it “lists open files“. And remember, in UNIX just about everything (including a network socket) is a file. Interestingly, lsof is also the Linux/Unix command with the most switches. usage: [-? As you can see, lsof has a truly staggering number of options. For me, lsof replaces both netstat and ps entirely. Key Options It’s important to understand a few key things about how lsof works. Here are a few others like that to keep in mind: default : without options, lsof lists all open files for active processesgrouping : it’s possible to group options, e.g. Getting Information About the Network As I said, one of my main usecases for lsof is getting information about how my system is interacting with the network. Show all connections with -i # lsof -i # lsof -i 6
howtoubuntu After Installing Ubuntu 14.10 Utopic Unicorn, there are a wealth of things that need to be dealt with, including Hardware Drivers, DVD, Audio and Video Codecs, Archiving formats, generally useful stuff. These instructions presume you are proficient with PPAs, .Debs, and other terminal commands, Ubuntu Tweak, and require a full set of video, audio, and archive codecs, as well as Skype, Flash, and a truck-load of wallpapers. Warning Using the sudo command can result in severe system damage. Make sure you type commands correctly, or copy and paste the entire code. 2. Both GetDeb and PlayDeb are repositories, sources of updates for actual software you have or will have installed. While this may look like an awful lot of code for something that should be relatively simple, you should know that while GetDeb and PlayDeb are repositories, they're not launchpad hosted, and hence a little more difficult to add. LibDVDCSS is a library required for reading some DVDs. 7. 8. 9. 10.
How Graphics Cards Work" The images you see on your monitor are made of tiny dots called pixels. At most common resolution settings, a screen displays over a million pixels, and the computer has to decide what to do with every one in order to create an image. To do this, it needs a translator -- something to take binary data from the CPU and turn it into a picture you can see. A graphics card's job is complex, but its principles and components are easy to understand. Think of a computer as a company with its own art department. A graphics card works along the same principles. Creating an image out of binary data is a demanding process. The graphics card accomplishes this task using four main components: A motherboard connection for data and powerA processor to decide what to do with each pixel on the screenMemory to hold information about each pixel and to temporarily store completed picturesA monitor connection so you can see the final result Next, we'll look at the processor and memory in more detail.
Bash Shortcuts For Maximum Productivity It may or may not surprise you to know that the bash shell has a very rich array of convenient shortcuts that can make your life, working with the command line, a whole lot easier. This ability to edit the command line using shortcuts is provided by the GNU Readline library. This library is used by many other *nix application besides bash, so learning some of these shortcuts will not only allow you to zip around bash commands with absurd ease :), but can also make you more proficient in using a variety of other *nix applications that use Readline. I don’t want to get into Readline too deeply so I’ll just mention one more thing. By default Readline uses emacs key bindings, although it can be configured to use the vi editing mode, I however prefer to learn the default behavior of most applications (I find it makes my life easier not having to constantly customize stuff). Command Editing Shortcuts Command Recall Shortcuts Command Control Shortcuts Bash Bang (!) !! Image by djhsilver Related
Tough Android Battery Covers, Mac App Exposé, and Windows Trackpads Readers offer their best tips on removing Android battery covers, seeing which friends have actually quit Facebook, and improving your Windows trackpad with a minimal tweak. Don't like the gallery layout? Click here to view everything on one page. Every day we receive boatloads of great reader tips in our inbox, but for various reasons—maybe they're a bit too niche, maybe we couldn't find a good way to present it, or maybe we just couldn't fit it in—the tip didn't make the front page. Open tricky Android back covers with a staple remover Bilbo Baggins points to a more finger-friendly, frustration-reducing way to pop the back cover on certain Android phones: I've noticed that a lot of Android phones (and even some feature phones) have those battery covers that are obnoxious to open. Flip Through Any Mac App's Windows from the Dock Pyrohacker notes that you don't even need to have an app in focus in Mac OS X to explore its elements through Exposé: Photo by Kai Hendry.
Linux Manpages Online - man.cx manual pages