r/linux_programming • • Jul 07 '21

NetworkManager interface-up shell script

7 Upvotes

Hi, I've a network related command I want to run it each time my wireless interface card is up. So, is there any way to do it with a script that should be run everytime by network manager ?


r/linux_programming • • Jul 04 '21

dlopen tries to load a dependency which I already loaded manually

7 Upvotes

not sure if I worded the title right but say I have 2 .so files called foo.so and bar.so, both placed in the same directory

bar.so depends on foo.so which I loaded manually using dlopen, when I tried to load bar.so it seems like dlopen tries to load foo.so from default search directory (like /lib, /usr/lib, etc) which because of foo.so isn't in one of those default search directory dlopen failed to find the file then returning null when I tried to load bar.so (this is my assumption, I might be wrong here)

code: (error handlings are omitted)

dlopen("./my_lib/foo.so", RTLD_LAZY); // this call succeeded
dlopen("./my_lib/bar.so", RTLD_LAZY); // but this doesn't

RTLD_NOW also gives the same result


r/linux_programming • • Feb 26 '21

Java NativeLibrary: Interface of library does not extend Library.

7 Upvotes

Hey,

I'm trying to load libvlc to interact with it via the vlcj bindings and I'm on Debian and using IntelliJ.

NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(),"/usr/lib");
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);

returns

Exception in thread "main" java.lang.IllegalArgumentException: Interface 
(LibVlc)           
of library=vlc does not extend Library
at com.sun.jna.Native.loadLibrary(Native.java:643)
at com.sun.jna.Native.loadLibrary(Native.java:630)
at core.main.main(main.java:15)

Trying boolean found = new NativeDiscovery().discover(); on the other hand returns false.

Originally I tried to load libvlc without NativeLibrary but I didn't succeed. I hoped NativeLibrary would make it easier. What am I doing wrong here?

I read it may have something to do with the LD_LIBRARY_PATH variable not being set? But setting LD_LIBRARY_PATH="/usr/lib/" doesn't change anything.

What may be interesting: I tried using Haskell in Intellij a while ago and tried to add the stack executable from /usr/bin/stack through the project settings, but I just couldn't find it using Intellij's file dialog. It just wasn't shown there even though I could clearly see the executable with my normal file manager and through the terminal. So maybe this has something to do with a variable not being set and Intellij not having rights to view the files or something?

Thanks in advance! Best, Nono


r/linux_programming • • Jan 12 '21

make vs make .

7 Upvotes

When you run make it runs all section.

ie:

all: gcc test.c -o test

what does make . run?


r/linux_programming • • Nov 07 '20

Terminal widget toolkit FINAL CUT 0.7.0 released

Thumbnail self.linux
7 Upvotes

r/linux_programming • • Oct 28 '20

Why this doesnt work?

7 Upvotes

r/linux_programming • • Aug 07 '20

Software advice: git tools for dealing with multiple repos

7 Upvotes

Hi all :)

I'm working on a Node.js project with a modular codebase whereby each module is a separately hosted repo/npm module.

I wondered if there are any good tools for managing multiple git repos in a project like this - most of the tools I've tried are geared towards single repos and get a bit messy when dealing with lots of repos. I started to look into git's submodules at one point, but it all seemed to get a bit complicated...

I'm specifically looking for something that quickly and easily lets me do the following (ideally as a bulk process):

  • Pull latest

  • Check changes

  • Stage changes

  • Commit/push changes

Can be a GUI or terminal/bash-based. If there's nothing like this out there, I'll go down the bash script route (not ideal given my n00b bash skills).


r/linux_programming • • Jun 05 '20

How can i make an ui program?

7 Upvotes

How do i create an ui application on linux on c++ with similar design tools like java swing?


r/linux_programming • • Mar 20 '20

Learning GTK programming: How do I not block the GTK main loop from executing after calling a handler function?

7 Upvotes

safe rainstorm crush impolite uppity marvelous boast observation sleep act

This post was mass deleted and anonymized with Redact


r/linux_programming • • Dec 16 '19

OpenGL context without X and/or Wayland?

7 Upvotes

On Linux is it possible to create an accelerated OpenGL context with monitor output without the use of neither X server or Wayland (or any display server for that matter)?


r/linux_programming • • Dec 07 '19

I need help with creating a login history shell script.

7 Upvotes

It needs to list users in ascending and descending order based on their number of log ins; and the time they spent logged in.

the first one: Example Emily 25 login

the second one:

name day:hour:min min
Example Emily 1:22:18 3778


r/linux_programming • • Nov 26 '19

Script that checks a youtube channel page daily and downloads new content?

7 Upvotes

I have a bash script that will download youtubes videos, but only with manually supplied urls. I would like to be able to add a function to it that will check the a channels page for new content and if there is any download it so i can add it to my cron daemon to have it run daily. Does anyone know how i would go about that? Maybe save a copy of the page and then use diff to compare the page when checked the next day, and if theres a difference, delete the previous saved version of the page? I keep trying to think of ways and keep confusing my self. Help!


r/linux_programming • • Sep 23 '19

Game Voice Changer - Read microphone, Apply "voice", Output to virtual microphone device

7 Upvotes

I record raw microphone with:

pacat --record -d alsa_input.usb-0c76_CMTECK-00.analog-mono

and it works.

Now I want to add "voice" to it, change it's pitch, and more, for games. So I pass the output of pacat to:

sox -t raw -r 16000 -c 1 - virtmic

where virtmic is the filename . It doesn't recognize the stdin . Can you help me?

I tried removing the '-' but it says :

sox FAIL sox: invalid option

My full command:

pacat -r | sox -t raw -r 16000 -L -b 16 -c 1 - virtmic

Output:

sox FAIL formats: bad input format for  `-': data encoding or sample size was not specified

I created virtual mic with this command:

pactl load-module module-pipe-source source_name=virtmic file=/home/shlomi/virtmic format=s16le rate=16000 channels=1

And I disabled auto-defaulting of input device , so that it records from my mic:


r/linux_programming • • Feb 20 '19

netdata, the open-source real-time performance and health monitoring, released v1.12 !

7 Upvotes

Hi all,

We just released netdata v1.12 !

This release introduces netdata.cloud, a free service that replaces the old netdata registry, while providing single sign on with GitHub and Google accounts.

New data collectors:

  • activemq

  • consul

  • cups

  • lighttpd2

  • solr

  • springboot2

Dozens of other data collectors improved:

  • adaptec_raid

  • apache

  • apcupsd

  • apps

  • cpufreq

  • cpuidle

  • dns_query

  • fail2ban

  • freeradius

  • go_expavar

  • hddtemp

  • httpcheck

  • lighttpd

  • mdstat

  • megacli

  • nginx

  • nvidia_smi

  • portcheck

  • postgres

  • power supply

  • sensors

  • smartd_log

  • SNMP

  • ZFS

Netdata now has a new management API that supports disabling or silencing alarms during maintenance periods.

Netdata can now bind its API functions to separate ports (so that different ports can be used for dashboard access, registry access, streaming, etc).

Finally, we improved installation and updates.


Check the release log at github.

If you are new to netdata, check a few live demos at its home page and the project home at github.

Netdata is FOSS (Free Open Source Software), released under GPLv3+.

Enjoy real-time performance and health monitoring!


r/linux_programming • • Dec 27 '18

Tips for a newbie?

7 Upvotes

I've been programming on Windows for a while now, want to switch to a Linux machine. Any suggestions on what tools/IDE's I should try? I'm mostly interested in using C++ and Java. Went with Linux Mint XFCE. Thanks in advance!


r/linux_programming • • Feb 26 '18

Useful text file PMPv0.0.18.sh with GUI

Thumbnail
github.com
7 Upvotes

r/linux_programming • • Feb 21 '18

Ubuntu 18.04 First Look

Thumbnail
youtube.com
7 Upvotes

r/linux_programming • • Jan 20 '18

Add bash comment line completion to your own programs.

Thumbnail
hackaday.com
7 Upvotes

r/linux_programming • • Feb 16 '17

Porting is a Delicate Matter: Checking Far Manager under Linux

Thumbnail
viva64.com
7 Upvotes

r/linux_programming • • Jan 08 '17

The Linux Command Line: A Complete Introduction (book) is on sale at the moment for $27.63 (-31%)

Thumbnail
twitter.com
7 Upvotes

r/linux_programming • • Sep 25 '16

Netstat Command Line Tips and Tricks

Thumbnail
hostpresto.com
7 Upvotes

r/linux_programming • • Aug 02 '16

ELF-dependency-walker is a tool to view the dependencies of an ELF object/executable

Thumbnail
peter.kingofcoders.com
7 Upvotes

r/linux_programming • • Jun 16 '16

Dual Boot Chrome OS

Thumbnail
watchmetech.com
7 Upvotes

r/linux_programming • • May 24 '16

Learning CMake: A beginner's guide

Thumbnail
gitbook.com
7 Upvotes