Skip to content

Instantly share code, notes, and snippets.

View vladak's full-sized avatar

Vladimir Kotal vladak

  • Europe
View GitHub Profile
@vladak
vladak / projektor.md
Last active October 2, 2019 12:38
projektor MS
xrandr --addmode DP-2 1440x900

What is OpenGrok

  • blindingly fast source code search and cross-reference engine
    • can be used for searching and source code browsing
    • “grok” = profoundly understand
      • in our case, source code
  • the IP/project is still owned by Oracle
    • developed as open source (CDDL license)
  • Searching computer programs that use different semantics
  • written in Java/JSP
  • originally developed as a tool perform security vulnerability research quickly
@vladak
vladak / ubuntu-notes.md
Last active September 27, 2025 16:42
Ubuntu notes

Service management

  • temporary: sudo service stop mydesktop
  • permanent: sudo systemctl disable mydesktop

DNS servers debugging

  • get local DNS server address: cat /etc/resolv.conf
  • get list of DNS servers: netplan get all
  • show who is listening on port 53 netstat -peanut (without lsof)
- mysh: go through detailed task description
- can start coding right away (parsing), do not have to wait until fork()/pipe()/exec() are explained
- the shell cannot (and should not) be coded in couple of days
- write your own unit tests
- demonstrate how to use Github+Travis
.travis.yml:
language: c
compiler:
- clang
- notable features/changes in 1.1:
- RESTful API
- Python scripts
- indexer parallelization
- Suggester (Adam Hornacek's master thesis)
- new highlighter
- LOC column
- no packages anymore
- Search CLI EOF
- project centric approach
foo
+--------+
| |
+--------+
tasks:
- rewrite queue-simulation.c to use RW locks
- add another thread that will print the number of items
in the queue less frequently than the main thread
- run atomic-add in multiple modes, compare the results
- write pthread_barrier impl
- start with phtread_barrier_t, pthread_barrier_wait()
- rewrite semaphores/posix-sem-fixed-race.c to use unnamed
semaphores. Are they kernel persistent ?
- signals and threads (*go through the slide first*):
- create process with N threads
- see if sending a signal to the whole process with multiple threads will deliver the signal to
different threads (perform various activities in the threads - I/O, CPU intensive, mix of both, ...)
- define a foo_t type as structure with a reference count and implement 2 macros:
FOO_REHOLD - bumps the refcount
FOO_REFRELE - decrement the refcount and if 0, call foo_free()
that will de-initialize the data structure
- implement negative unit test
- finish the sleep -> join (thread num in argv[1]) task
- write a simple program that creates couple of threads, each doing a number arithm ops
- after random number of the ops, the thread SIGSEGV's, observe the result
- compile with debug flags, see if gdb can display stacks of all threads at the moment of crash
- write simple program with 2 thread types - one sleeping in syscall, another looping and printing to stdout
- create more than 1 thread of each type
- the threads doing syscals can e.g. pick a random file from /etc directory, open it and read it
- each thread will write its own thread ID to stdout once running
- goal: see if the other threads run while another sleeps in syscall
- see if truss/strace can display thread IDs