command

run command/script when lock/unlock windows station?

若如初见. 提交于 2019-12-02 22:23:40
I have Windows 7 pro at work. My problem is I keep on forgetting to clock in/clock out (using the intranet timesheet system). Is there a way to run a script or command to automatically open the timesheet page each time I lock/unlock my station? Yes, windows 7 task scheduler allows a dizzying array of new ways to schedule tasks: One is on log on, and another is on event which could be a security event for locking the workstation. Administrative Tools --> Task Scheduler - Create Task --> Triggers Tab --> New Button --> Begin Task drop down box... etc. 来源: https://stackoverflow.com/questions

IntelliJ IDEA disable font increase/decrease on CMD+scroll

邮差的信 提交于 2019-12-02 21:01:34
I am using IntelliJ IDEA 9.0.2 on Mac OS X - with the Magic Mouse. Whenever I press the command button and move my finger a micrometer or two on the surface of the mouse, IDEA immediately increases or decreases my font size rapidly. How can I disable this feature? CrazyCoder Settings | Editor | Enable Ctrl+MouseWheel changes font size (On Mac it would be Preferences | Editor | General | Enable CMD+MouseWheel changes font size .) IntelliJ IDEA 14.1 By default it is disabled and it can be found here: File > Settings... > Editor > General > Change font size (Zoom) with Ctrl+Mouse Wheel The option

Color ouput with Swift command line tool

牧云@^-^@ 提交于 2019-12-02 20:45:55
I'm writing a command line tool with Swift and I'm having trouble displaying colors in my shell. I'm using the following code: println("\033[31;32mhey\033[39;39m") or even NSFileHandle.fileHandleWithStandardOutput().writeData("\033[31;32mhey\033[39;39m".dataUsingEncoding(NSASCIIStringEncoding, allowLossyConversion: true)!) It works when I use a simple echo in php (the text is displayed in green) but is there a reason it doesn't work in a Swift command line tool? Thanks! cyt Swift has built in unicode support. This invalidates using of back slash. So that I use color codes with "\u{}" syntax.

WPF-Prism CanExecute method not being called

雨燕双飞 提交于 2019-12-02 20:25:50
I am coding a simple login UserControl with two TextBoxes (Username and Password) and a Login button. I want the Login button to be enabled only when the username and password fields are filled in. I am using Prism and MVVM. The LoginViewModel contains a property called LoginCommand that is bound to the Login button. I have a CanLoginExecute() method in my ViewModel but it fires only when the application comes up and then never again. So the Login button is never enabled. What am I missing? Here's my xaml: <TextBox x:Name="username" Text="{Binding Path=Username, UpdateSourceTrigger

Kill Command in linux

一曲冷凌霜 提交于 2019-12-02 19:57:20
问题 I have a bash script abcd.sh ,in which I want to kill this command (/usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat') after 5 sec but in this script it kill sleep command after 5 second. #!/bin/sh /usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat' & sleep 5 kill $! 2>/dev/null && echo "Killed command on time out" 回答1: Try #!/bin/sh /usr/local/bin/wrun 'uptime;ps -elf|grep httpd|wc -l;free -m;mpstat' & pid=$! sleep 5 kill $pid 2>/dev/null && echo "Killed

cmake installer for Mac fails to create /usr/bin symlinks

旧城冷巷雨未停 提交于 2019-12-02 19:04:34
Try to install CMake cmake-2.8.12.2-Darwin64-universal.dmg on OS X 10.9.3 I removed the old version from Application folder and delete ccmake, cmake, cmake-gui etc in usr/bin. But get "Failed create symlink installation may be incomplete: /usr/bin/cpack" and other error messages. Please let me know if any suggestion or question. Thank you for precious time on my question. This tends to happen to me as well from time to time. The problem is basically that the symlinks from the previous installation are not cleaned up when removing CMake from Applications and now the installer has trouble

Maximum number of inodes in a directory? [closed]

只愿长相守 提交于 2019-12-02 18:50:45
Is there a maximum number of inodes in a single directory? I have a directory of over 2 million files and can't get the ls command to work against that directory. So now I'm wondering if I've exceeded a limit on inodes in Linux. Is there a limit before a 2^64 numerical limit? tonylo df -i should tell you the number of inodes used and free on the file system. Robᵩ Try ls -U or ls -f . ls , by default, sorts the files alphabetically. If you have 2 million files, that sort can take a long time. If ls -U (or perhaps ls -f ), then the file names will be printed immediately. No. Inode limits are per

Mercurial log with one-liners

拟墨画扇 提交于 2019-12-02 18:01:27
The regular hg log command gives output with at least 4 lines per changeset. For example changeset: 238:03a214f2a1cf user: My Name <my.name@example.com> date: Thu Aug 26 09:49:32 2010 +0200 summary: Added tag v1.1 for changeset f22fd3974361 I mean to remember that there was a command to print a log in a more compact way what just had one line per changeset. A format that you could basically stick in a changelog.txt file and it would look nice. Does that exist? Or am I mixing this with something I have seen with git or something else? in3xes hg log --style compact You can also use templates to

Awk command - calculation of columns

隐身守侯 提交于 2019-12-02 17:50:58
问题 I am very new in Awk. I want to calculate the difference between first row column2 and second row column2. For instance: Num1 Num2 23 26 34 39 43 58 63 61 So, I want to calculate from Column (Num1) 34-23, 43-34, 63-43. And same for column(Num2). Can you please help me. I can only calculate the value within rows which is $1 - $2 , but not within column. 回答1: Remember the old values (from the previous row). awk 'NR > 1 { print $1 - old1, $2 - old2 } { old1 = $1; old2 = $2 }' data.file 回答2: You

What is /bin/true

我与影子孤独终老i 提交于 2019-12-02 17:50:20
On a Linux system what is /bin/true ? /bin/true is a command that returns 0 (a truth value in the shell). Its purpose is to use in places in a shell script where you would normally use a literal such as "true" in a programming language, but where the shell will only take a command to run. /bin/false is the opposite that returns non-zero (a false value in the shell). user231967 From the man page: true - do nothing, successfully true returns a status 0. Note, it's not just silly or visually nice. It helps for example to exit a program without activating the end handlers which might mess up when