terminal

module_init not showing the printk that I want it to

拟墨画扇 提交于 2019-12-11 14:18:54
问题 I am trying to make my module display a printk . I'm new to this so I might have some programming errors. This is my module C file: #include <linux/linkage.h> #include <linux/time.h> #include <linux/module.h> asmlinkage long sys_mycall(int myid, char* firstname) { printk ("Hello, %s! \n sys_mycall called from process %d with ID %d. \n", firstname, current->id, myid); return 0; } static int my_init(void) { return 0; } static int my_exit(void) { printk("Goodbye!"); return 0; } module_init(sys

BASH: Read all files in a directory recursively, includinging symbolic links

十年热恋 提交于 2019-12-11 14:07:38
问题 I got this tidy script from someone: find ../Classes -name \*.cpp -print which simply loops a directory, and prints all files recursively. However, it doesn't follow symlinks. All I can find online is: find ../Classes -name \*.cpp -type l -print But, since the directory is the symlink, not the files, it outputs nothing. How can I solve that? 回答1: Tell find to follow symlinks with -L find -L ../Classes -name \*.cpp -print 来源: https://stackoverflow.com/questions/16693828/bash-read-all-files-in

Frequency distribution from wav files

前提是你 提交于 2019-12-11 13:42:52
问题 I found out that I can use SoX's play file.wav stat -freq to generate a table of levels against frequencies for a file. However, it seems to run in real time, i.e. takes as long to complete as the audio does to play. How can I generate the same table of frequencies and levels but in the shortest time possible? 回答1: The output of SoX is rather slow, but this is mainly caused by the displaying. One solution could be to redirect the output of SoX (which is on the standard error (stderr) stream

Can I keep the terminal as the active window, even if it's in the background? - Python 3.3

二次信任 提交于 2019-12-11 13:17:26
问题 G'day, I've just posted this question here. Following on from that, is there a means to lock keyboard user input to the terminal, when it's running behind another window? My system requires a user to scan their barcode (barcode scanner acts as a keyboard. ie. outputs a string of letters and presses enter) inside the terminal. However, the system also requires that a log CSV file be displayed on the attached monitor. As such, with the terminal in the background, the cursor automatically

What is the ANSI escape code sequence “ESC[>c”?

风流意气都作罢 提交于 2019-12-11 13:05:44
问题 After typing "vi [FILENAME]" in the bash I get the following result: .... \r\"gu1.txt\" 16L, 87C ESC[>cESC[1;1H 111\r\n1112 ..... The first text marked in the this row is the file name following the number of lines and columns of the vi result. The second text includes two escape sequences which I don't understand their meaning : ESC[>c and ESC[1;1H . The last text includes the text shown as a result of the vi, i.e. the content of the file. Can you please explain what is the ANSI escape code

Viewing LaTeX Output in Emacs

假如想象 提交于 2019-12-11 12:49:57
问题 I am trying to view the output of a LaTeX file in Emacs. I am following this guide: http://www.r-bloggers.com/using-doc-view-with-auto-revert-to-view-latex-pdf-output-in-emacs/ I have done everything they said, but when I run C-c C-c and open the pdf in the other Emacs window, I get nonsense. Preferably, I want the pdf to immediately show in the other window when I run C-c C-c --I do a lot of live texing, and I need to periodically view the output. Please note that I am running Emacs from the

laravel artisan commands colors not showing

ε祈祈猫儿з 提交于 2019-12-11 12:37:45
问题 When using laravel artisan commands, I don't get the expected color output. If you look at http://laravel.com/docs/4.2/commands , it says "To send output to the console, you may use the info, comment, question and error methods. Each of these methods will use the appropriate ANSI colors for their purpose." But using terminals mintty or cmd, I don't get those colors. For instance, $this->error('Something went wrong!'); should output the text with a red background. What is missing so that I get

how to use junit from the terminal

核能气质少年 提交于 2019-12-11 12:24:33
问题 I am trying to use junit in the terminal. I have a class Abc.java class Abc{ public int add(int a, int b){ return a+b } } and i have created a class AbcTest.java import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import static org.junit.Assert.*; class AbcTest { public void testAdd() { System.out.println("add"); int a = 0; int b = 0; Abc instance = new Abc(); int expResult = 0; int result = instance.add(a, b);

Why do I have to use java -cp . (class name) and not java (class name)?

冷暖自知 提交于 2019-12-11 12:07:41
问题 I was just curious why on some systems like mine, I have to utilize java -cp . and simply using the java command in the terminal window doesn't work ? 回答1: When you are launching a JVM using the java command, the JVM's classpath is determined as follows: If you use the "-jar" option, then the classpath consists of the JAR file itself, and together with the optional "Classpath" attribute in the JAR file. Otherwise, if you use the "-cp" option, the option's value gives the classpath Otherwise,

How do I compare the contents of all the files in a directory against another directory?

南笙酒味 提交于 2019-12-11 11:48:13
问题 I have a directory with a bunch of C files, .c and .h , and another very similar directory of files that a coworker has sent that have very minor differences, due to an update, and I'd like to see what those differences are. I could run a diff on every file manually, but as they're named the same is there anyway I could do it quicker and easily see which files are different and what makes them different? 回答1: diff command is able do it. Just try: diff directory1 directory2 回答2: You may find