News for hackers. Stuff that matters.

surki

Re:CPU Utilization is Wrong on Wednesday May 10, 2017 @02:23AM (#14306276)
Another related tool I found interesting: perf c2c

This will let us find the false sharing cost (cache contention etc).

https://joemario.github.io/blog/2016/09/01/c2c-blog/

I do something like

  find $PWD -type f -ls | awk '{gsub("/", ";", $11); print $11" "$7}' | flamegraph.pl --title "Disk usage" --countname "bytes" --nametype "file" --width 1900 --minwidth 0.05
Re:GNU GLOBAL source code tagging system on Monday November 17, 2014 @01:20AM (#8617077)
I have been using Global for about 6 years now. Mostly I use it in emacs (though at times I use the CLI version).

I use it in Linux and Windows. I mostly work on C/C++ (Linux kernel, Windows drivers etc) and also have used it for few C# projects (via exuberant ctags backend).

One real advantage I get: I switch platforms between Linux and Windows (the place I work for has both). So I use emacs in both platforms and same gtags customization works out of box in both platforms. This relieves me in learning/using new editor/tagging system for each platform.

FWIW: my dot emacs https://github.com/surki/dotemacs/blob/master/init.org

Re:How OpenBSD Leverages Malloc to Find Bugs on Monday November 28, 2011 @02:18PM (#3287166)
What you describe is implemented in these libraries: libduma (http://duma.sourceforge.net/) and efence (http://linux.die.net/man/3/efence)

They also have buffer underflow protection (either overflow or underflow at a time).

But in 32 bit systems, for applications that heavily use memory, you may run out of address space

Re:Smallest x86 ELF Hello World on Tuesday October 11, 2011 @12:54PM (#3099323)
Doing it in C with mixed assembly

  [surki@linux-vrse tt]$ cat | gcc -nostdlib -x c - -o helloworld
  #define SYS_exit  1
  #define SYS_write 4
  #define stdout    1
  
  int strlen(const char *str)
  {
    long len = 0;
    while (str && *str++)
    {
        len++;
    }
  
    return len;
  }
  
  
  void print(const char *str) 
  {
      int len = strlen(str);
  
      long ret;
  
      /* Can't touch ebx directly, PIC uses it */
      __asm__ __volatile__ ("pushl %%ebx\n"
                            "movl  %%esi, %%ebx\n"
                            "int   $0x80\n;"
                            "popl  %%ebx"
                            
                            "a" (SYS_write),
                              "S" ((long) stdout),
                              "c" ((long) str),
                              "d" ((long) len));
      return;
  }
  
  void _start()
  {
    main();
  
    __asm__ __volatile__ (
         "xorl %%ebx, %%ebx\n"
         "int $0x80\n"
         
         "a" (SYS_exit));
  }
  
  int main()
  {
    print("Hello World\n");
    return 0;
  }

  [surki@linux-vrse tt]$ strip -R .comment -R .comment.SUSE.OPTs -R .note.gnu.build-id helloworld
  [surki@linux-vrse tt]$ ll helloworld 
  -rwxr-xr-x 1 suresh users 540 2010-07-21 13:19 helloworld
  
  [surki@linux-vrse tt]$ ./helloworld 
  Hello World
For moving or persisting X applications you would need something like http://en.wikipedia.org/wiki/Xmove
Re:GNU Emacs Theme Generator (beta) on Friday December 31, 2010 @03:50AM (#2054945)
Probably you are using x selection buffer for copy/paste. But if you want to pick up stuff from X "clipboard" buffer, you would need xsel or something like that.

Wanderlust is quite usable now. I use it everyday(I have my gmail and exchange server(imap) accounts managed in it). You should give it another try sometime.

Re:GNU Emacs Theme Generator (beta) on Friday December 31, 2010 @01:50AM (#2054782)
I use a similar setup with urxvt and stumpwm. In stumpwm I have

    ;; Launch emacs
    (defcommand emacs () ()
       (run-or-raise
        "urxvt -title emacs -e screen -U -dRR -S emacs -c ~/.screenrc.emacs"
      '(:title "emacs" :instance "urxvt" :class "URxvt")))
which will launch emacs (or raise it if it was already launched).

Some of the thing you might want to consider when doing "emacs -nw"

  - Make sure your TERM is exported appropriatly.
    Otherwise you may end up with less colors (M-x list-colors-display).
    Screen fiddles with TERM and emacs may end up supporting less colors.

  - Copy/Paste between regular X apps and the emacs will not work.
    You would need to use something like "xsel". See here [1]

  - Some of the keys may not work as expected. This will be 
    apparent especially when using orgmode. You may want to 
    remap them appropriately
And also I suggest you use Emacs + Wanderlust setup for email (and put it in a screen session as well).

[1] http://hugoheden.wordpress.com/2009/03/08/copypaste-with-ema...

Re:The "other" side of file sharing on Wednesday December 29, 2010 @05:20AM (#2048418)
I think "The Man from Earth" was also partially distributed through torrents. At least that's what the wikipedia claims - http://en.wikipedia.org/wiki/The_Man_from_Earth
I use something like this to watch the processes that are running or waiting for IO

  watch -n 1 ps -eo pid,ppid,wchan=WIDE-WCHAN-COLUMN,stat,command r
Re:Ask HN: How do you secure yourself on public WiFi? on Monday October 25, 2010 @02:00PM (#1830824)
You probably want to use tsocks. It LD_PRELOADs the socket related functions and does the necessary work.

http://tsocks.sourceforge.net/faq.php

Re:Ask HN: Best emacs / git integration? on Thursday October 21, 2010 @05:41PM (#1817559)
I starting using magit recently, but I am still to get used to it.

Here is a link discussing about git support in Emacs that I found useful:

http://alexott.net/en/writings/emacs-vcs/EmacsGit.html

How about doing something with imagemagick or mencoder? I think video encoding/decoding gives a nice balance between disk and cpu usage.
Well, the example(at least the first one) in that video is bit skewed. First, he runs gzip and then immediately runs 'parallel gzip' without dropping disk caches. So in the later case the bottleneck would be CPU rather than disk IO(everything read from disk cache in the RAM). IMO I expect for the work that is IO bound we won't see any significant improvement using parallel or anything similar.
Re:All about GNU Screen on Sunday August 29, 2010 @03:24AM (#1643359)
I strongly recommend having a look at the Gnu Screen customization in Ubuntu Server.

http://blog.dustinkirkland.com/2008/12/ubuntu-server-include...

Re:Mozilla Fennec Alpha Released for Android and Nokia N900 on Friday August 27, 2010 @02:50PM (#1639757)
I see, thanks for the update. It would have helped if the title was Fennec 2.0 Alpha, not just Fennec Alpha. I would give it a try sometime this weekend.
Re:Mozilla Fennec Alpha Released for Android and Nokia N900 on Friday August 27, 2010 @01:38PM (#1639482)
Am I missing something? I remember trying this on a Nokia N810 about 1.5 years back, was quite slow, I gave up.

Looks like they are still working on it.

http://talk.maemo.org/showthread.php?t=21428

http://www.mozilla.org/projects/fennec/1.0b1/releasenotes/

Re:What is LaTeX and Why You Should Care on Tuesday August 03, 2010 @02:33PM (#1572162)

  > Not perfect, but I find it's more natural to write in org-mode 
Do you have any specifics on the problems you faced? I produced my master thesis entirely using orgmode without any problem. (defined custom latex class, with different kind of ToC etc, not that difficult)
Re:Emacs, artist mode on Monday August 02, 2010 @10:49AM (#1567764)
Check EmacsWiki as well: http://www.emacswiki.org/emacs/ArtistMode

Especially integration with Ido mode.

Re:Emacs-fu: some handy key bindings on Saturday July 31, 2010 @06:19AM (#1563522)
Checkout hs-minor-mode as well. Great for sifting through code (or xml, html etc)
Re:Useful things you can make SSH do on Thursday July 22, 2010 @07:54AM (#1537884)

  Got a computer behind a firewall whose configuration 
  you don’t have access to? It’s pretty easy to get the 
  computer behind the firewall to poke out to another 
  server.

  (step 1, from the computer you wish to access)
  derwiki@firewalledcomputer:~$ ssh -R   localhost:2002:localhost:22 mypublicserver.com

  (step 2, from any computer than can access  
   mypublicserver.com)
  derwiki@mylaptopontheinternet:~$ ssh mypublicserver.com -p 2002
  (authenticate)
  derwiki@firewalledcomputer:~$
If you want to keep it running always, you may want to consider "autossh" (restarts ssh connections if they ever exit/disconnect)
Re:I am doing a startup (putting virtual machines on the web) on Wednesday July 21, 2010 @09:45AM (#1535148)
OK, didn't see that one. But technically it should be possible to do that(i.e., pure web rendering through JS) for TS as well.

What I meant to ask was - how does it compare using VNC against RDP. Probably you have through and rejected RDP, so was curious to know the technical details. (xrdp for Linux exists as well)

Re:I am doing a startup (putting virtual machines on the web) on Wednesday July 21, 2010 @09:29AM (#1535111)
That's pretty neat.

If you are going to support Windows, how does stackvm compare against "Terminal Services Web Access (TS Web Access)" [1]

[1] http://technet.microsoft.com/en-us/library/cc771908(WS.10).a...

Older »