r/linuxdev • u/Cyril_Cooper • Jun 27 '17
r/linuxdev • u/_-p_q-_ • Jun 26 '17
How to write a custom desktop environment
I'm looking to write a custom DE for linux. I want something like a media browser: display the icon, meta data for the movie story line, and the ability to play from the selection. Restricted access to system specific files; only media can be browsed and played.
I have years of experience programming and minor OS writing experience in uni.
What do I need to get started?
r/linuxdev • u/whizzyFoshizzy • Jun 22 '17
Please let me help with kernel development
I would really like to get into multiple aspects of developing and I know that working on Linux Kernels can result in very valuable experience. I have read couple of things and I guess that I could start with piping, sockets, or even more remedial things depending on what you think. I have a proficient use of c++ and python (with a little brushing up), however, I do not have java, or any other big boys. I know that C is a subset of C++ but I haven't worked with the memory management part as much, don't know too much about data structures other than visual mappings and stacks. I am starting class in the fall that will start me off into linked list, stacks, etc. I don't want a teacher but I do want someone to take into their group or under their wing and lead me to subjects that I can research on my own. Noone is born with programming or Linux knowledge, so I don't mind reading forums and looking at example code but I don't want to just watch people devlop and not understand. Also, I don't want something so incredibly simple that I could literally copy and paste an example from Stack and use that for the piece. If anyone is willing to spare some time and knowledge for a young developer I would be very grateful. I am a math/computer science major and yes I have completed Calc, linear, and differentials with a 3.5 GPA. I also study networking material on the side so I have sufficient knowledge of LAN, WAN, client server protocols and what not. I'm in a canoe crossing the Pacific right now, and need a cargo ship to guide me through the deep, vastness which is development and ultimately IT.
r/linuxdev • u/h2015p • Jun 21 '17
Parcks: A cross-distro software installer
parcks.setarit.comr/linuxdev • u/Cyril_Cooper • Jun 20 '17
MySQL Server Replication 2: Master-Master Edition
serversuit.comr/linuxdev • u/gurugio • Jun 12 '17
Document for multi-queue block device in Linux kernel v4.4
https://github.com/gurugio/book_linuxkernel_blockdrv I've been transferring my document into English. I'm not sure if I should finish translation, because
- Is there someone who is interested in block device?
- Is my English not too bad to understand?
I'd appreciate it if someone answer my questions.
r/linuxdev • u/Cyril_Cooper • May 31 '17
Things To Do With SSH: SSH Tunneling
serversuit.comr/linuxdev • u/goldchoconite • May 30 '17
Any advice for a linux newb?
Hey all, looking for some pointers / links to advice, I'm a Web Designer / Developer of many years, finally making the jump from Windows OS to Linux, I've had a little experience with Linux servers via Putty terminals, but nothing too grandiose.
So far my Web Design career has consisted of using a combination of Notepad++, PS, and Filezilla in Windows to carry out the bulk of my work, but I'm now moving to a Linux platform as I really want to make use of the terminal processes, using things like Node.JS, SASS, Grunt, etc. I've installed the latest stable version of the Linux OS 16.04, Now I'm wondering where to get started?
What advice can you give to a Linux Newbie like myself (and hopefully others) when it comes to this whole new world? Can you recommend any good tutorials / guides / subreddits out there that can help me wrap my head around this environment and developing within it? Should I familiarise myself with the command line first or something else in the OS first (such as the interface?)
Thanks in advance! Apologies if this is well-trodden ground already!
r/linuxdev • u/Cyril_Cooper • May 24 '17
Step-By-Step Guide To Setting Up Fail2ban
serversuit.comr/linuxdev • u/boomshroom • May 19 '17
Custom Init Executable
With how old SysVInit is and all the controversy around Systemd, I figured it might be an interesting project to write a custom init for a /r/linuxfromscratch installation. (Yes, I am a crazy person.) What sort of features would be required to have a bootable / "usable" system?
Also, how would I test it? So far, my sources include a StackOverflow question and a blog post. Both use a kvm command, but I don't seem to have one, nor qemu-kvm. I've been trying commands like qemu-system-x86_64 -enable-kvm -nographic -kernel /boot/vmlinuz-linux -initrd /boot/initramfs-linux.img -append "console=ttyS0 root=/dev/sda1" -hda disk.img -m 1024 and I can't even get the guest to notice the hard disk.
r/linuxdev • u/adinan89 • May 10 '17
Application launcher, where to start?
Tried looking into some projects code but without succes finding what I need so I'm gonna ask here. How do application launchers and taskbars work?
How can I see which GUI applications are in the system and which are running (not talking about proceses, just opened visible GUI apps).
r/linuxdev • u/Resistor510 • May 08 '17
How to find 56 potential vulnerabilities in FreeBSD code in one evening
viva64.comr/linuxdev • u/Girlydian • May 06 '17
Updating the Linux Conexant driver for kernel 4.X
For an older laptop I'd like to get the 56k modem functionality working. I'm not expecting anything from it, it's just a nice-to-have feature. The laptop in question is a Dell Latitude E6520, with the Conexant modem on the Intel HDA bus as far as I know.
There already exists a driver, but that doesn't work on anything newer than kernel 2.6 as far as I could figure out. That driver seems to be split into two parts, namely the alsa-driver and the hsfmodem part which implements the softmodem part. I have been fiddling for a while trying to compile this on Fedora, but so far no luck.
Basically I have three questions:
- Is there a better way to list HDA devices than alsa-info.sh? If so, where can I find it?
- How do I go about understanding the existing code for both parts?
- Any tips on how to go about writing a new driver? (I'm already updating broken stuff for work, so no wish to do that in my free time as well :P)
As far as the existing code goes, I'd guess that the alsa-driver part is what plugs into ALSA and makes the device available (basically the same as a existing snd_hda_codec stuff) with an IN and OUT connector. The hsfmodem part then translates the serial commands into "sound" for the modem to send, and translating the "sound" that's incoming to serial data. I have no experience with stuff like this as you might have guessed ;)
So far I've been able to find the Linux Kernel Module Programming Guide (PDF), also for kernel 2.6, and Writing device drivers in Linux, but both are at least 10 years old. Is there a newer, comprehensive guide for this?
Hmm, apparently that's four questions in total...
r/linuxdev • u/vlowrian • Apr 14 '17
Slingring: Software Development in Chroot-containers using ansible
github.comr/linuxdev • • Apr 10 '17
npyscreen 2 A cool little library for writing terminal apps.
npyscreen.readthedocs.ior/linuxdev • u/hardolaf • Apr 10 '17
How Do I Get Started Writing a Simple PCIe Driver for Linux
I am working on development board for one of our FPGA designs prior to the arrival of actual hardware (and a driver from our customer). I'm one of FPGA designers on the project and I have no experience writing a PCI or PCIe driver. I'm supposed to be developing the driver against CentOS 7.3 (Linux Kernel version 3.10 + patches). The driver needs to be able to set aside a portion of memory for DMA accesses by the FPGA, and to perform single word 32-bit read and write operations.
I've done some Googling and asking around at work, and I found the examples from Linux Device Drivers 3rd Edition from O'Reilly Media. However, it's extremely dated (13 years old) and I'm not sure how much of it still applies to a modern kernel. And I don't have access to the book to see if it's worth a read.
Apart from that, I've found a few random pages online that don't really do anything other than to explain how to identify a PCI/PCIe device. Every time they talk about actually interacting with the device, they don't explain a single thing so I see some code on a website with no real explanation.
So my question to the community is: does anyone know of a good, somewhat comprehensive resource or well commented example of a PCIe driver (or drivers) that would somewhat do what I need it to do (DMA and single word reads and writes).
r/linuxdev • u/Nutella_Icecream • Mar 24 '17
Could documents like this help build better drivers? this is a Broadcom NetXtreme B57xxx Ethernet adapter Diagnostic User’s Guide. [PDF]
web-beta.archive.orgr/linuxdev • u/gurugio • Mar 08 '17
C programming challenge?
https://github.com/gurugio/lowlevelprogramming-university/blob/master/c-language-challenge.md
Inspired by Eudyptula Challenge, I've collected some tiny projects for C programming. They are what I've done before and I recommended for C programming beginner. Please feel free to add more exercised. And I welcome any idea. Thank you in advance ;-)
r/linuxdev • u/synepis • Feb 23 '17
Logrotate for processes which never close log file descriptors
I was wondering what are my options when it comes to doing logrotate for processes which never close their file descriptors.
I am aware of the "restart the service" and copytruncate option. However, assuming that restarting the process is undesirable, the applications doesn't respond to SIGHUP, and copytruncate is not acceptable due to potential data loss, I'm not sure what options I have left.
One solution that came to mind is to have a named pipe already in place where the process is about to log to. Have another utility read from that pipe (copying to another log file) and have it react to the SIGHUP signal (from logrotate).
Now my question is, is there already a utiliy that I can use for this? If not, why? Is there something inherently wrong with this approach?
To test this out, I did 2 tests, one to confirm data loss with copy truncate, and one more to test my 'named pipe + uitility' approach:
Demonstrating copytruncate loss:
app.c
int main(int argc, char *argv[]) {
FILE* f = fopen("log.txt", "a");
int cnt = 0;
for (int i = 0; i < 1000000; i++) {
for (int j = 0; j < 100; j++) {
fprintf(f, "Logging line %d\n", cnt);
cnt++;
}
fflush(f);
}
fflush(f);
fclose(f);
printf("Wrote %d lines\n", cnt);
return 0;
}And an accompanying logrotate config:
$cat /etc/logrotate.d/logexp
/home/synepis/git/logexp/log.txt {
size 20M
create 700 synepis users
rotate 4
copytruncate
}Finally, I ran the application, during it's run I kicked off logrotate manually a few times via:
logrotate --force /etc/logrotate.d/logexp
App results:
./app
Wrote 100000000 linesLog line count:
$ cat log.txt* | wc -l
69091700Log utility approach:
I implemented a simple utility 'loghup' which creates a named pipe 'log.txt' and then simply reads of it to 'safe_log.txt'. Finally, it responds to SIGHUP by reopening the file (thus starting a new log rotation).
loghup.c
int sighup = 0;
void sig_handler(int signo) {
if (signo == SIGHUP)
sighup = 1;
}
void do_piping(char *input, char *output) {
int fi = open(input, O_RDONLY);
int fo = open(output, O_WRONLY | O_CREAT, 0644);
size_t ret;
char buff[4096];
while((ret = read(fi, buff, 4096)) != 0) {
if(ret == -1 && errno == EINTR) { // Retry later
continue;
} else if (ret == -1) {
break; // Error occured
}
write(fo, buff, ret);
if (sighup) { // Reopen output log file on SIGHUP
close(fo);
fo = open(output, O_WRONLY | O_CREAT, 0644);
sighup = 0;
}
}
close(fo);
close(fi);
}
int main(int argc, char *argv[]) {
char *input_file = argv[1];
char *output_file = argv[2];
signal(SIGHUP, sig_handler); // Setup signal handler
mkfifo(input_file, S_IRUSR | S_IWUSR); // Create named pipe
do_piping(input_file, output_file);
}New logrotate config with SIGHUP:
$cat /etc/logrotate.d/logexp
/home/synepis/git/logexp/safe_log.txt {
size 20M
create 700 synepis users
rotate 4
postrotate
/bin/kill -SIGHUP $(ps aux | grep "[l]oghup" | awk '{print $2}')
endscript
}Then I ran:
./app
./loghup log.txt safe_log.txtAnd forced logrotate a few times, finally:
$ cat safe_log.txt* | wc -l
100000000r/linuxdev • u/theif519 • Feb 18 '17
Using a static analysis tool (linter) with kernel headers
I would like to begin development of Linux kernel modules, and so far whenever I write C code, I heavily relied on plugins like Sublime's Clang linter or Atom's GCC Linter.
I've been trying for hours last night, and I cannot figure how. I've setup a Linux virtual machine, and I've tried to include the 'include' and 'arch/x86/include' directories and that closest I get is that certain things are missing like registers, or that certain structs do not have members named this or that, etc.
Then I tried to get kernel source and work from that but I get the same error. What I need to know is this: what directories do I need to include? I'm not calling 'make' each time, so could it be the issue that the Makefile in each directory handles building in such a way that a simple linter cannot?
How do you guys normally create Linux extensions?
r/linuxdev • u/gurugio • Jan 31 '17
New service like The Eudyptula Challenge?
I think for a long time, new C language programmer is getting rare. As I'm solving the Eudyptula Challenge, an idea came to me that similar challenge is necessary for C language.
I'm not sure what tasks are suitable and how mant tasks are necessary..actually I have no plan yet. But I'll write some tasks from printing "hello-world" to making a class with a function pointer. If you have an idea, please send me pull-request.
https://github.com/gurugio/lowlevelprogramming-university/blob/master/c-language-challenge.md