Far Manager has powerful suppport for command history. ConEmu author even suggests using Far Manager with panels turned off instead of standard command prompt.
Ctrl+E gives you previous command entered. You can press it multiple times to get older entries. Ctrl+X moves you forward in the history.
Press Alt+F8 to view command history in the list:
You can execute a command from the list by pressing Enter. If you want to edit a command press Ctrl+Enter.
All shortcuts available in command history list:
Re-execute a command
Re-execute a command in a new window
Re-execute a command as administrator
Copy a command to the command line
Clear the commands history
Lock/unlock a history item
Delete the current history item
Ctrl+C or Ctrl+Ins
Copy the text of the current command to clipboard
Another useful shortcut is Ctrl+Alt+F – it lets you to search in the list by filtering it down. This shortcut is totally non-obvious and not documented anywhere so I was happy when I discovered it. It also works in folder history (Alt+F12).
I did 10-day Vipassana meditation course in July 2012. Meditation centre was located in Woori Yallock – small town near Melbourne.
First of all, my notion of meditation was shattered there. In my mind, meditation was sitting quietly and relaxing, something like this:
Well you do sit quietly but it is not relaxing at all, at least not in Vipassana meditation. It is hard work. It is simple but not easy at all.
What helped me is that I decided to allow myself to be a newbie. I said to myself: “It’s OK to do it poorly it the beginning”.
There were about 40 students total. Men and women were living in separate areas.
Talking to each other was not allowed. Many people told me that this would be very hard for them. However I didn’t find it difficult at all. Maybe this is because I was not a very sociable person.
Also there was no Internet, no TV, no radio, no phones, no visitors. I handed in my mobile phone in the beginning of the course for safe keeping. There was no communication with outside world at all.
We didn’t read anything. There were no writing materials. Actually I missed pen and paper during the first half of the course. I was getting so many excellent ideas during meditation and I wanted to write them down so that I don’t forget them.
We were spending a lot of time meditating. Here is typical timetable:
Morning wake-up bell
Meditate in the hall or in your room
Group meditation in the hall
Meditate in the hall or in your room according to the teacher’s instructions
Rest and interviews with the teacher
Meditate in the hall or in your room
Group meditation in the hall
Meditate in the hall or in your own room according to the teacher’s instructions
Group meditation in the hall
Teacher’s Discourse in the hall
Group meditation in the hall
Question time in the hall
Retire to your own room – Lights out
Getting up at 4 am in the morning was hard for me. In the beginning I was walking during rest times but later on I was trying to get as much sleep as possible. Walking, by the way, is the only form of exercising allowed.
We had breakfast and lunch but no dinner. Instead of dinner we had two pieces of fruit and tea. Somehow I didn’t miss dinners and wasn’t particularly hungry in evenings. The food was delicious, I liked it very much. Oh, and it was all vegetarian.
Meditating itself wasn’t in complete silence. In the beginning and the end of each session there was chanting played as recording. I found it strange at first but with time grew to almost like it.
I would never associate meditation with pain. Yet initially I experienced a lot of pain and discomfort. Sitting without moving for long time becomes painful. Later on I found out that in fact you can change posture from time to time. So I didn’t have to go through all this suffering. Oh well, I still think it was beneficial for me.
The main idea of Vipassana meditation is observe different sensation on your body while maintaining “perfect equanimity”. You try to be aware of your body.
In the evening the teacher discourse was given. This was recordings of S.N. Goenka, a leading teacher of Vipassana meditation. This is where theory behind the meditation was given.
At the start of the course management strongly recommended me to listen to discourse in my first language (Russian). I was glad I agreed because the material was quite thick. It was hard for me to follow it even in Russian. My English was definitely not good enough to follow discourse in English.
The theory included subatomic parts, vibrations and future lives which was hard to swallow for me raised in atheistic Soviet Union.
On day 8 I finally became aware of my leg. It was fascinating – it felt like my leg lit up with sensations like a Christmas tree. Immediately after that I was able to get a flow of subtle sensations which felt incredible. I can compare it to the opening sequence from Universal Studios logo:
I felt ecstatic after that and couldn’t stop smiling I must admit that I couldn’t get that flow again since then.
Surprisingly I got many revelations about my life during last days of the course. I realized how misguided I was in many aspects of my life. I understood why I behaved in certain ways.
On the last day I felt very happy and was eager to talk to fellow students. I think everybody else felt blissful.
Overall the course was great. I strongly recommend it to everyone. What I like about Vipassana meditation is that it helps everyone, regardless of their religion, race, age and background.
It is hard, sometimes even gruelling but it is very beneficial. I think it’s like a boot camp for your mind. You can find more about it at Vipassana website.
One of the strongest features of Far Manager is the ability to start any program or script from command prompt. You can type anything there, just like in standard command prompt. Ctrl+Enter shortcut greatly helps here – it inserts selected file name to command prompt (Ctrl+F inserts full path).
If you launch a console program all program output will be displayed in Far window. Terrific! After program finishes you can view console output by pressing Ctrl+O.
There is a problem however: you can’t scroll up if program output is long. Only last 25 or so lines of text are visible. Anything before that is lost forever.
Far has a clever little known trick to view all program output. Add view:< before the command and all console output will be intercepted and redirected to internal viewer. For example:
You can even redirect output to Far editor by using
This is nice but not ideal. You have to remember to add view:< before starting a console program or script. If a program takes long time to execute you won’t see any progress until it finishes. Also any interactive prompt in program screws the whole process.
ConEmu to the Rescue
ConEmu is a console emulator. It has lots of great enhancements to standard Windows command prompt. It works by intercepting all console output and displaying it in its own window.
ConEmu is also a close friend with Far Manager. After installing ConEmu you can open Far Manager inside ConEmu window:
Once Far Manager is inside ConEmu tab you can scroll console output by switching to so called alternative mode.
This mode hides Far panels and ‘freezes’ console. Ctrl+Up scrolls up, Ctrl+Down scrolls down. Scrolling with a mouse wheel also works.
But that’s not all. You can also assign Ctrl+O to view console output in Far viewer. To do this locate CtrlO_View.reg in ConEmu folder and execute it.
depending on whether I use the “-File” or “-Command” switch to execute the .ps1 script I get different behaviour. Is this a PowerShell bug or is there something fundamental about the execution model the differs between -File and -Command that I’ve yet to understand?
How to execute PowerShell script from NAnt script:
Far Manager has two keyboard shortcuts to copy file name to clipboard:
Ctrl+Ins copies selected file name
Alt+Shift+Ins copies full path to selected file
These shortcuts also work if multiple files are selected which is great for creating batch renames.
Let’s say file name contains spaces. In this case Far Manager adds quotes around file name. Supposedly this saves time if you construct some command line somewhere. Personally I find this totally unnecessary. I can add quotes myself, thank you very much.
File or folder names, containing characters specified in rule 34, will
be quoted when inserted into the editor/command line or the clipboard.
The key "System/QuotedName" of DWORD type controls this behaviour.
0 - if set then file or folder names will be quoted inserted into
the editor/command line.
1 - if set then file or folder names will be quoted inserted into
The default value = 0xFFFFFFFF (quote file or folders names).
I think you need to be a developer to understand this.
Note two similar shortcuts:
Ctrl+Enter copies selected file name to command line
Ctrl+F copies full path
For this auto-quoting is actually useful, therefore I set QuotedName to 1, not 0.
Occasionally I want to edit plain HTML file in Visual Studio. You know, those files with .htm or .html extension. Normally pressing Enter in Far Manager opens them in a browser. This is what I want most of the time, so let’s keep it.
Idea: let’s use F4 key to open file in Visual Studio.
Here’s how to achieve it:
* Open Commands menu, select File associations.
* Add new association, enter *.htm;*.html as a mask. Enter this command for F4:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /edit "!.!"
Change path to devenv.exe if you have different version of Visual Studio.
Note the /edit parameter. It makes Visual Studio to re-use existing window if it is alredy running. Visual Studio is not exactly a lightweight editor so let’s be efficient here.
What if you want to open HTML file in internal Far editor? Simple: press Alft+F4.
I use s3.exe command line utility to backup photos to Amazon Simple Storage (S3) and it works great.
I have lots of photos to backup: 900,000 files in 4,000 folders.
Obivously it is impractical to copy all files on every backup – it will take forever. s3.exe has exact feature that I need:
/sync is used with the put command and only uploads files that do not exist on S3 or have been modified since last being uploaded, based on the timestamp. It can be used alone or in conjunction with the /sub option for a fast incremental backup of a whole directory.
Here’s command line that I use for backups:
s3.exe put mybucket C:\photos\ /sub:withdelete /sync /acl:public-read /yes /nogui
When I started using S3 however I was surpised with the bill from Amazon.
Let’s open source code to see how backup is done. Here are relevant bits:
For each file s3.exe gets last modified date from the storage. If it is greater than last modified date of local file then no upload is performed.
Let’s do some calculations. To get last modified date s3.exe sends HEAD request. Amazon charges $0.01 per 10,000 HEAD requests. So I would end up paying $0.09 every time I perform backup. If I do it every day that’s $27 per month.
Let’s try to optimize it. How about this: for every local folder get the corresponding list of files in storage. Last modified date will be included in response. Now we’re going to issue about 4,000 LIST requests (1 for each folder). 1,000 LIST requests is $0.01 so that would be $0.04 in total. Or $1.20 per month – that’s saving ofÂ $25.80 – a big win
I have started working on my own business in December 2008. Here’s the progress so far.
Idea is very simple: Â web gallery with shopping cart for wedding photographers. For more details see my older post.
Fotrel is a web application. My clients use it as a service. The whole software-as-a-service model has a great appeal to me. I can make money while I sleep. There is no pain ofÂ acquiringÂ new clients.
I’ve set the price to $95 per month right from the beginning. I didn’t want my product to look cheap. On the other hand it is flat price. I don’t like the idea of charging commission for this kind of service. For some reason it feels like putting my hands in client’s pocket. After all, my expenses are exactly the same regardless of how many orders my client gets.
Then, after reading Jay Abraham’s book I got an idea: charge $95 per month only if photographer has sales in that month. This creates a safety net for my clients: if my product doesn’t bring profit to them at least they are not losing money on it. This should be especially appealing to small (one-person) studios. Also, when you have sales paying $95 feels like giving away part of the profit, not parting with your own money. So far people like this idea. It certainly makes it easier to say yes rather than no.
Not everyone pays me each month because of the pricing structure. So it is somewhat hard to tell if someone is my customer. A photographer could sign up for my service just to try it out and then never come back. I define my client as someone who has uploaded at least one wedding or portrait gallery in past 3 months.
At the moment I have 15 clients.
On average, I get $300 per month.
You might be wondering why I have those redÂ months with negative profit.
OccasionallyÂ I launch a program from Far Manager that takes very long to complete. Normally you can use Ctrl+Alt+Tab to “detach” Far from a running process. Technical note #27 explains this well:
If a long-running process (for example, archiving) was run in a FAR console, and for some reasons this very instance of FAR is needed (an editor in the background) or it is undesirable to run a new instance ofFAR, pressing this key combination will create a new console for FAR where it will continue running as if the process has already ended, and the process will continue working in the old console.
Unfortunately this doesn’t work on Windows 7. Instead of detaching you get Windows task switcher:
Interestingly the switcher is in “sticky” mode. It doesn’t disappear when you release keys. You can use arrow keys to select a window.
The fix is easy:
Start regedit, open HKCU\Software\far2\System key.
CreateÂ ConsoleDetachKey string value, set it to some keyboard shortcut. I use CtrlAltX.
Restart Far Manager
To test it try executing this command from Far:
ping google.com -t
Press Ctrl+Alt+X to get back to Far without stopping pings.