prompt
stringlengths
1
63.6k
completion
stringlengths
1
53.1k
Hi all! I have a Canon Powershot A95 digital camera. I want to move my pictures from the camera to my hard drives but I'm having some trouble: When I plug in the camera (through a USB) debian detects my camera and asks if I want to import my images. However, when I try to import nothing happens. When looking in usbview I see it detects my camera. I tried installing gphoto2 and running "gphoto2 -P" but what I get is: Code: Select allDetected a 'Canon:PowerShot A95 (normal mode)'. *** Error (-114: 'OS error in camera communication') *** For debugging messages, please use the --debug option. Please help me...
jazzman wrote: Code: Select allDetected a 'Canon:PowerShot A95 (normal mode)'. *** Error (-114: 'OS error in camera communication') *** For debugging messages, please use the --debug option. I'm not familiar with your camera, but with many models you must set your camera's 'USB Connect' to 'PTP', not the 'Normal' setting.
I have a strange problem with my printer. It prints but in a strange way. When I go to localhost:631, add the printer and print a test page, it's OK. Then I can print from other applications too. But when I reboot, I can't print anything. Then if I go back to localhost:631 and modify the printer by specifying the PPD file and print a test page, everything works again until I reboot. How to fix?
Is there any reason why you are using the http://localhost:631 CUPS interface to configure your printer instead of the configuration tools provided in Gnome or KDE? What, if anything, didn't work in those tools?
I'm trying to get a ncurses based application (ncmpc, a frontend for mpd) to display on a terminal running on a Palm PDA, connected by USB to a Linksys NSLU2 (slug). The terminal seems to work fine, but when I try this ncurses application, it doesn't quite work. Text characters seem to display ok, but the horizontal lines do not (I get funny text characters instead), and the screen scrolls up instead of staying still (if you know what I mean). I followed the advice here to get the Palm talking to the slug (very easy, but if anyone cares, the visor module works for the Palm, is already present and loads automatically in Debian, so ignore the stuff about the pl2303 module). And I use this line: Code: Select allgetty -h -L ttyUSB0 9600 vt100 to get a terminal, or this in /etc/inittab Code: Select allT0:23:respawn:/sbin/getty -h -L ttyUSB0 9600 vt100 (this last is best because the terminal is recreated every time you plug in the Palm) Both of these have the same result. So, my question is, does anyone know (or guess) of any tweaks I can perform at the slug end (ie those commands above), because there do not seem to be any options at the Palm end. You can change the baud rate and the flow control, but not the terminal type, and not much else. Specifically, is there a way of telling getty to create a terminal that is 32 characters wide and 16 rows high? I couldn't find anything in man getty that would allow you to specify the terminal size. And is there a way of sorting out the display of lines etc (ncurses stuff)? Should I try a different terminal type? Which one? I should say that the application works fine when I run it through an ssh terminal on another PC running linux (though I just realised that when I use PuTTY on a Windows machine I get the problem with lines etc, but not the problem that seems to be related to display size). It's not just about fonts, is it? Or character sets? I've only got one 'Charset' available on the Palm, called ISO-Latin1, maybe I just need a fixed-width font with ncurses characters in it? Anyone know anything about this stuff? Thanks Bernie
I found this, but I don't understand how to relate it back to the Palm.
Before upgrading from sarge 3.1r1 to etch 4.0r0, an Intel 537EP Winmodem worked in Debian using a semi-closed source Intel driver. After upgrading to Etch (and kernel 2.6.18 ), the driver won't compile. The error is Code: Select all Module precompile check Current running kernel is: 2.6.18-4-686 /lib/modules... autoconf.h exists autoconf.h matches running kernel version.h matches running kernel 2.6.18-4-686 make[1]: Entering directory `/mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv' make -C /lib/modules/2.6.18-4-686/build SUBDIRS=/mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv modules make[2]: Entering directory `/usr/src/linux-headers-2.6.18-4-686' CC [M] /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.o /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:70: warning: data definition has no type or storage class /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:70: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL_NOVERS' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:70: warning: parameter names (without types) in function declaration /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'power_callback': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:295: error: 'PM_SAVE_STATE' undeclared (first use in this function) /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:295: error: (Each undeclared identifier is reported only once /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:295: error: for each function it appears in.) /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'softcore_init_struct': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:336: warning: assignment from incompatible pointer type /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'open': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:394: warning: implicit declaration of function 'pm_register' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:395: warning: assignment makes pointer from integer without a cast /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'close': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:416: warning: implicit declaration of function 'pm_unregister' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'send_data_to_user': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:563: error: 'struct tty_struct' has no member named 'flip' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:568: error: 'struct tty_struct' has no member named 'flip' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:569: error: 'struct tty_struct' has no member named 'flip' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:571: error: 'struct tty_struct' has no member named 'flip' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:572: error: 'struct tty_struct' has no member named 'flip' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:573: error: 'struct tty_struct' has no member named 'flip' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: At top level: /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:641: error: expected ')' before string constant /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'hamproc_write': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:660: warning: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: At top level: /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:754: warning: initialization from incompatible pointer type /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:755: warning: initialization from incompatible pointer type /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'kScheduleDPC': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:861: warning: implicit declaration of function 'pm_access' /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c: In function 'dspdrv_CommRamISR': /mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.c:877: warning: function declaration isn't a prototype make[3]: *** [/mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv/coredrv.o] Error 1 make[2]: *** [_module_/mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv] Error 2 make[2]: Leaving directory `/usr/src/linux-headers-2.6.18-4-686' make[1]: *** [537core_26] Error 2 make[1]: Leaving directory `/mnt/hdb2/Art4/bin/WinModem/intel-537EP_secure-2.60.80.0/coredrv' 2.6.18-4-686 Failed to build driver Someone suggested on IRC that I use sl-modem-daemon. I tried it, but it quit with this error: Code: Select allFATAL: Module ungrab_winmodem not found. FATAL: Module slamr not found. Starting SmartLink Modem driver for: auto. Creating /dev/modem symlink, pointing to: /dev/ttySL0. So what worked in Sarge isn't working in Etch, and my Debian system has no internet access. I could try downloading a possibly newer Intel driver again...
Sorry to not have any answers, but might i suggest you take a look at the stuff on http://www.linmodems.org, im not sure if your card will work with those intel drivers, but they have a good way of finding out using there scanmodem tool, it helped me out with back when i was on 56k.
Hi, I just bought an LG GSA-H50N DVD burner and I am having problems burning a DVD in both K3b and Nero under Debian Etch. They both seem to error out during the process with some kind DMA driver / CRC error. Does anyone have this burner in their Debian system? Here's some info. Code: Select allhomer:/home/andy# uname -r 2.6.18-4-amd64 homer:/home/andy# Code: Select allhomer:/home/andy# hdparm -i /dev/hdc /dev/hdc: Model=HL-DT-STDVD-RAM GSA-H50N, FwRev=1.00, SerialNo= Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic } RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0 BuffType=unknown, BuffSize=0kB, MaxMultSect=0 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 udma2 udma3 *udma4 udma3 *udma4 AdvancedPM=no Drive conforms to: Unspecified: ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 * signifies the current active mode homer:/home/andy# Relevant lines of dmesg: Code: Select allhomer:/home/andy# dmesg | grep hdc ide1: BM-DMA at 0xf408-0xf40f, BIOS settings: hdc:DMA, hdd:DMA hdc: HL-DT-STDVD-RAM GSA-H50N, ATAPI CD/DVD-ROM drive hdc: ATAPI 48X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache, UDMA(66) homer:/home/andy# I am using an Asus M2NPV mobo, and the in the BIOS settings, I have PIO and DMA both set to "Auto". Looking for any suggestions or thoughts on fixing this. Or maybe it's a kernel problem? Thanks, Andy
hallo, IMHO you're using a wrong IDE Cabel ! Cabel must be a ' UDMA 66 ' EDIT: hdparm -i /dev/hdc /dev/hdc: Model=HL-DT-ST DVDRAM GSA-4167B, FwRev=DL13, SerialNo=D334CA784E73 Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic } RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0 BuffType=unknown, BuffSize=0kB, MaxMultSect=0 (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 *udma2 AdvancedPM=no Drive conforms to: Unspecified: ATA/ATAPI-2,3,4,5 * signifies the current active mode but K3B or Nero works for me !?! CooSee ' Ya
Can not get these devices to enable - except during install process. All else about install was success, I think. Error says "must specify the filesystem type" and it gives a return code from mount = 32 'mount failure'. I've tried all combos of jumper settings and with one or two devices installed. Here is the set-up: the CD-RW is set to Mount Point = /media/cdrom1/dev/hdd the DVD is /media/cdrm0/dev/hdc filesystem type is "auto" on both What should the filesystem be set to and where do I get that info? Thanks in advance for help w/ this. I've tried for a couple of days after reading various threads and HOWTOs and can not figure this one out. Chuck
Chuck What are you running? lenny with 2.6.18 or what? I had a lot of trouble with this too--SATA related. It took me quite a while to sort it all out, but its fine now. Are you using scsi-emulation or ide or what? Your post suggests ide, but check with fdisk -l to make sure. /dev/hda or /dev/sda ? What do you have in /etc/fstab? Also check dmesg. Perhaps dmesg | grep -i cd George
Hello, has somebody tested this card http://www.a-link.com/uk/PC100R-N.html?id=EybzdnVL with Etch? Where I can find drivers? -Vit
I haven't tried that particular card but the rtl8139 is probablly the most common 10/100 PCI (cardbus is essentially PCI with hotplugging and PCMCIA backwards compatibility added) ethernet controller in the world. Every linux distro should include the driver for it as standard.
hi there all - after lots of trials and tribulations i have switched from ubuntu to debian etch for a home server. i have installed etch base plus file and printer server packages from the cd and than installed webmin as it is headless. took me a while to get samba working - i'm kind of newbie to linux and it was a bit of a fiddle but now it works i want to share an external hard drive connected through usb (the machine is an old laptop and the internal hd is for system only) i can mount it through fstab using /dev/sdb1 and sdb2 etc but being usb when i will plug another hard drive it might reallocate the sdb numbers differently... few month ago i followed this article: http://howtos.linux.com/howtos/Flash-Me ... ml#hotplug to get it working on an older ubuntu but when i got to install hotplug it gave me a messege that my kernel-image will be removed or so i understood so i stopped... so how do i get debian etch to recognise the hd ids and mount by them rather than by sdb numbers? cheers michel
If the drive will always stay connected to you laptop you can safely use the /etc/fstab option, otherwise i am not sure how you could keep a persisitant mount of the drive as it *is* removable media. so my suggestion is keep it plugged in and always boot with the drive plugged in. maybe someone else a little more familiar with your issue can help you better.
I installed rt2500-source and installed it via module-assistant. I managed to connect to my router and internet works, however scanning doesn'n reveal anything: thor:~# iwlist eth2 scan eth2 Interface doesn't support scanning : Bad address it's also strange that the driver named the interface eth2 since in all other distros it was ra0 my info: debian etch x86 2.6.18-4-amd64
solved. had running an amd64 kernel on an x86 system
Hello everyone ! I really need help on this, and I fear it's a tough one. I recently installed Debian on my laptop through goodbye-microsoft.com (because my disk drive is dead and my motherboard can't boot from USB). The installation went well, as far as I can tell - I'm a complete newbie at Linux, so I can't be sure... I did set a root password in the installation process, one containing letters and numbers - at this point, my keyboard was recognized as a standard qwerty so I could type it correctly. Big mistake !! because when booting on the brand new Debian, I am warned of a bad XKB (which I understand means keyboard config), and I cannot type any numbers, meaning that I can't type root password, meaning... Well, I suppose you understand what kind of useless system the poor Debian turns into without root access on a fresh install. My laptop is an Acer Travelmate 2100 with French keyboard (azerty). When I press the number keys, with or without shift, with or without caps lock, all I get is [!,",#,'] and so on. I have Windows XP installed on another partition. Is there some way for me to fix the XKB ? (maybe through XP..?) Or do I need a complete reinstall ? Thanks in advance for the help.
Are you in X (Like KDE or Gnome)? If so, are you able to use the F keys? Can you use Ctrl-Alt-F1 to get into a terminal? If so you can log in as your user and check if the number keys work. Then, assuming they do work in the terminal, you can log in as root and run Code: Select alldpkg-reconfigure xserver-xorg to reconfigure X. I know there is a lot of 'if' but might be worth a shot. Tina
Hello, Upgrading the BIOS to 1.1.4 didnt help. SO tried using the kernel arguments I managed to solve (as of now) the mouse freeze problem in my 64b machine. title Debian GNU/Linux, kernel 2.6.20-1-amd64 root (hd0,0) kernel /boot/vmlinuz-2.6.20-1-amd64 root=/dev/sda1 ro noapic irqpoll pci=routeirq initrd /boot/initrd.img-2.6.20-1-amd64 savedefault title Debian GNU/Linux, kernel 2.6.20-1-amd64 (single-user mode) root (hd0,0) kernel /boot/vmlinuz-2.6.20-1-amd64 root=/dev/sda1 ro noapic irqpoll pci=routeirq single initrd /boot/initrd.img-2.6.20-1-amd64 still waiting to see if this thing freezes on me ! hope this helps some
update: the mouse never froze after that. BUT i was logged out 2 times (random) when i was using a GUI intensive application (commercial,school stuff). I haven't been able to reproduce this behavior though.
Hi, could somebody kindly help me to install this PCMCIA Wlan card? I can't compile a driver from A-Link web-site: http://www.a-link.com/uk/WL54PC.html Thanks in advance - Vitali
Which chipset does it have?
I just installed Debian Etch, but it's only reporting 885mb ram when I really have 2gb! optional@testmachine::~$ free -m total used free shared buffers cached Mem: 885 410 475 0 19 225 Here's my uname -r: Linux testmachine 2.6.18-3-486 #1 Mon Dec 4 15:59:52 UTC 2006 i686 GNU/Linux and my machine specs: CPU: 1.8ghz athlon xp ram: 2gb ddr ram This machine was running Ubuntu a few days ago, and Ubuntu detected all 2gb of my ram properly! I do not want to roll my own kernel, as I am using dm-crypt (as part of the "guided" install for LVM + encryption in the etch installer) and would rather not make a mistake that locks me out of my data! Any ideas on what to check? This is a completely new system: all I did was install, then apt-get update/dist-upgrade. Thanks!
Try to reseat your ram, It may not be seated tight.
Hi I have a Samsung YP-Z5 mp3 player (USB Mass Storage device) which I'm trying to get working with kernel 2.6.18. It works fine on my laptop under kernel 2.6.15 and also under windows so I think the device is ok. When I connect it to my desktop with the 2.6.18 kernel, I get these lines in /var/log/messages: Code: Select allOct 29 10:00:32 loki kernel: usb 1-1: new high speed USB device using ehci_hcd and address 5 Oct 29 10:00:32 loki kernel: usb 1-1: configuration #1 chosen from 1 choice Oct 29 10:00:32 loki kernel: scsi5 : SCSI emulation for USB Mass Storage devices Oct 29 10:00:43 loki kernel: usb 1-1: reset high speed USB device using ehci_hcd and address 5 Oct 29 10:00:43 loki kernel: usb 1-1: USB disconnect, address 5 Oct 29 10:00:43 loki kernel: scsi 5:0:0:0: scsi: Device offlined - not ready after error recovery The device doesn't show up in /dev/sdx or /dev/disk/by_id/usb_Samsung* so I can't do anything more with it. Note that when it said "USB disconnect" in the syslog I hadn't actualy unplugged it. No messages appear when I subsequently unplug the device. Any ideas what's causing this? If I use the device on my laptop or under windows then plug it into my desktop, it'll work fine the first time around and then start failing again. It won't even work if I restart the desktop, only if I plug it into another machine/OS.
Hey, I don't know exactly what's going on, but can make some educated guesses. I blame it 100% on the driver, try going to Device Manager, uninstalling the USB Mass Storage Driver and plug your unit back in, don't let it automatically update, go to add/remove hardware and manually find your driver needed on the unit itself (It's normally a hidden file). PS. I know this is an old thread, but i can't stand having unanswered questions go for months, that someone must know the answer for.
Hi again! I still haven't figured out what is wrong with the keyboard config but I decided to add an extra harddrive anyway. But I nust be doing something wrong, I can't find a "Howto mount HDD" either. When I start Debian I can see the Scsi disc as "scsi0 sdb id6 lun0" right after the sda. But when I type "mount dev/sdb" it says "cannot find sdb in /etc/fstab or /etc/mtab" And when I type "fdisk dev/sdb" I get "cannot open dev/sdb" What am I doing wrong?
fdisk /dev/sdb
hi all..i've got a problem... if i start my pc, with the usb phone connected, all the sound is played by it, bypassing the speakers! Instead, Starting with the phone disconnected, everything goes for the best...also if i decide then, to connect the phone... is there a way to solve this problem? it's boring to set up the sound by alsaconf everytime i forgot the usb connected. i tried using asoundconf list...but it gives me no results any tips? tnx for the attention M@
Well I have 0 experience w/ USB audio devices (except a USB headset that 'just works' TM) Oh well - you can't know it all right? Anyway, why not use tried and true methods? Code: Select allcat /proc/asound/cards You might also glean some info by inserting/removing the USB phone and running tail on your log: Code: Select alltail -f /var/log/messages Are you aware of /etc/modprobe.d/sound? You can define your soundcard therein. Mine looks llike so: Code: Select allalias snd-card-0 snd-ice1712 options snd-ice1712 index=0 alias snd-card-1 snd-bt87x options snd-bt87x index=1 alias snd-card-2 snd-intel8x0 options snd-intel8x0 index=2 Don't forget that you can store your settings: Code: Select allalsactl store I had never even heard of asoundconf until today when I read it 2 times in as many minutes. I tried that command here and it seems well...useless. The man page tells me it comes from Ubuntu and has been around since 2005. Surely I must be missing the point of this tool. man asoundconf asoundconf - utility to read and change the user's ALSA library configuration Change the library configuration? What does that mean exactly? Well I'll do some research later on that.
[ I haven't really solved the trouble, I found out I didn't wrtoe the good configuration files for PPP... now the connection is ok...] Hello I run Etch testing kernel 2.6.18-3, from the KDE 1 CD version. I've looked at several How-to's but I remain in haze. the firware. version1.3 .deb was not really appreciated since it was rejected for installation by the package manager. so I've installed the 1.2 firmware for my speedtouch usb modem... and the installation went ok. anyway it should be ok since i have the rev 0.0 of the modem. On my system, I can't find no trace of the README.Debian for the corresponding speedtouch firmware file,which was supposed to guide me for further configuration. However, following the how to's i found over the net, I completed the files for ppp configurations. The peers file and the corresponding pap-secrets and chap-secrets with what I think to be the correct values. The trouble appears when I run #pon It's dealing with an unresolved /dev/modem entry in my configuration file. I've check through the directory /dev and of course ther's no entry for this file... I don't know if I have to make symbolik link to somewhere, and and I don't know where... or maybe there are other ways... I don't know if my modem is well recognized also. Any help appreciated.
What type of Modem do you have??? In my experience, linux modem support is quite hit and miss.
I recieved this webcam for christmas and I am having difficulties getting it detected on etch. I installed the spca5xx modules for my kernel (2.6.18-3 amd64). No software can detect it and /dev/video + /dev/video0 do not exist. How can I add them / get the camera detected?
I guess you need to build your own kernel with the linux-uvc module: http://packages.debian.org/testing/grap ... uvc-source But maybe I can find better info, so just have a little patience and I might solve it for you.
I try to get ATI 3d working on my laptop but thusfar I have failed, leaving me with vesa driver. This is what I have done: Installed fglrx-kernel-2.6.17-2-686 fglrx-kernel-src fglrx-driver fglrx-driver fglrx-control Followed these instuctions: Building the kernel module -------------------------- Change directory to /usr/src and unpack the module sources: $ cd /usr/src $ tar xjf fglrx.tar.bz2 *** Make sure to remove any old /usr/src/modules/fglrx* directory *** after an upgrade of the sources package. You can build the kernel module in several ways. Using module-assistant is usually easiest and is therefore recommended. a) Build with module-assistant (recommended) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you have never built modules with module-assistant before, you should prepare the build environment by running: # module-assistant prepare In the usual environment, module-assistant should detect all requirements. Example (assuming that you build for the running kernel): # module-assistant a-i fglrx Now try to load the module by entering the following command as root: $ modprobe -v fglrx If everything goes well, modprobe prints the path of the module it loaded. The fglrx modules gets loaded. Changed my xorg.conf (changed vesa to fglrx and removed dri). With these settings xorg refused to start up. My xorg.conf Code: Select all# /etc/X11/xorg.conf (xorg X Window System server configuration file) # # This file was generated by dexconf, the Debian X Configuration tool, using # values from the debconf database. # # Edit this file with caution, and see the /etc/X11/xorg.conf manual page. # (Type "man /etc/X11/xorg.conf" at the shell prompt.) # # This file is automatically updated on xserver-xorg package upgrades *only* # if it has not been modified since the last upgrade of the xserver-xorg # package. # # If you have edited this file but would like it to be automatically updated # again, run the following command: # sudo dpkg-reconfigure -phigh xserver-xorg Section "Files" FontPath "/usr/share/fonts/X11/misc" FontPath "/usr/X11R6/lib/X11/fonts/misc" FontPath "/usr/share/fonts/X11/cyrillic" FontPath "/usr/X11R6/lib/X11/fonts/cyrillic" FontPath "/usr/share/fonts/X11/100dpi/:unscaled" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled" FontPath "/usr/share/fonts/X11/75dpi/:unscaled" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled" FontPath "/usr/share/fonts/X11/Type1" FontPath "/usr/X11R6/lib/X11/fonts/Type1" FontPath "/usr/share/fonts/X11/100dpi" FontPath "/usr/X11R6/lib/X11/fonts/100dpi" FontPath "/usr/share/fonts/X11/75dpi" FontPath "/usr/X11R6/lib/X11/fonts/75dpi" # path to defoma fonts FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" EndSection Section "Module" Load "i2c" Load "bitmap" Load "ddc" # Load "dri" Load "extmod" Load "freetype" Load "glx" Load "int10" Load "vbe" EndSection Section "InputDevice" Identifier "Generic Keyboard" Driver "kbd" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc104" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/input/mice" Option "Protocol" "ImPS/2" Option "Emulate3Buttons" "true" EndSection Section "InputDevice" Identifier "Synaptics Touchpad" Driver "synaptics" Option "SendCoreEvents" "true" Option "Device" "/dev/psaux" Option "Protocol" "auto-dev" Option "HorizScrollDelta" "0" EndSection Section "Device" Identifier "ATI Technologies Inc Rage Mobility M3 AGP 2x" Driver "vesa" BusID "PCI:1:0:0" EndSection Section "Monitor" Identifier "Generic Monitor" Option "DPMS" EndSection Section "Screen" Identifier "Default Screen" Device "ATI Technologies Inc Rage Mobility M3 AGP 2x" Monitor "Generic Monitor" DefaultDepth 24 SubSection "Display" Depth 1 Modes "1024x768" EndSubSection SubSection "Display" Depth 4 Modes "1024x768" EndSubSection SubSection "Display" Depth 8 Modes "1024x768" EndSubSection SubSection "Display" Depth 15 Modes "1024x768" EndSubSection SubSection "Display" Depth 16 Modes "1024x768" EndSubSection SubSection "Display" Depth 24 Modes "1024x768" EndSubSection EndSection Section "ServerLayout" Identifier "Default Layout" Screen "Default Screen" InputDevice "Generic Keyboard" InputDevice "Configured Mouse" InputDevice "Synaptics Touchpad" EndSection Section "DRI" Mode 0666 EndSection Who knows how I can solve this?
I don't think that the fglrx drivers will work with the Rage; you have to use open DRI. If I'm right.
I have a scanner that works fine when I am root, but when I'm a regular user xsane can't find the device. My user id is a member of the group scanner. I was able to use the scanner as a regular user if I chmoded /proc/bus/usb, but it is a pain to do this every log-in. My fstab line for proc is proc /proc proc defaults 0 0 Google hasn't been much help. I running etch with 2.6.12 kernel. Thanks in advance for any help.
I tried an experiment: I booted up without the scanner plugged into a usb port. After booting up I plugged in the scanner. This allowed me to run xsane as a regular user. This is a big pain. Suggestions on what to do would be appreciated.
hi all, I have this problem with dvd, as described in subject line: I'm using 2.6.18-686 kernel with latest udev/hal/dbus from testing When I insert dvd-rom (debian installetion image) I can't mount it receiving the following error: "wrong fs type, bad superblock...." I've tried it with packages from unstable also, no change. When I tried to find the source of the problem I've seen that when I insert cd-rom into the drive udev sends two messages: 1. that the new removable device is available. 2. the label of the new media these messages are received by hal and hal on his side gets the size of the newly inserted media from somewhere else (don't know from where yet) Thus allowing me to mount the cd-rom manually using mount or automatically through hal. However when I insert dvd into the drive, the messages from the udev are: 1. New removable media available 2. size of the new media 3. label The size that is reported by udev in this case is always 1f70hex (8048) regrdless of the dvd that is inserted. Hal sets the size of the media according to what he receives from udev, however in theory the hal's reported size should matter only to services that use hal. When I try to mount such dvd, I get error: "Wrong fs type or bad superblock...." kernel logs shows error: "bad superblock, trying to access beyond media boundries..." Which is understandable because of the wrong size that is being used. Disabling hal/dbus doesn't have any effect. Searching this and other forums I've got an impression that maybe other users experiencing the same problem, they just haven't found the source yet. Because of the problem appearing on 2.6.17 and 2.6.18 kernels I believe that the bug (if it is a bug) most probably in udev, however the only version available from repo's is 100 from testing, so I can't try another version. Can any one help me or point me in right direction of what to do to resolve this? The drive is nec ide dvd writer and is the only ata device. Thanks in andvance.
Well, I'm sorry I was too quick to blame After searching some more I've found on some mailing list a user describing the same exact problem with same exact kernel/udev messages with same exact dvd writer model: NEC 3550A. Apparently he discovered that his dvd was broken (laser burnt out), well after switching to other dvd drive I can mount dvd's again, so apparently my dvd writer is broken also Which is too bad cause a week ago its warranty period ended.
Just installed Sarge. Every thing works. Except printing. Set up printer in CUPS through both my browser and the KDE CC. The set up goes fine (my printer is recognized, etc) but nothing comes out of it. When I look at the job list, it says the jobs have been canceled... Any ideas?
Is ghostscript installed? apt-get install gs-esp
After an upgrade of my Etch system the newest cups (1.2.1-3) was installed and I can no longer print. Test pages via localhost:631 work, but when printing the printer list can't be retrieved because of a failed connection to cups server. Googling around I find some bug reports, but no work arounds. My printer (HP 5940) is on another linux system connected to a local network. Are there any simple ways to go back to an earlier version of cups? Or does anyone know a way around this? Thanks.
Are you using KDE?
I recently bought a Game-Elements GGE909 Controller at walmart (yeah 15 bucks). When I got home, i plugged it in and it worked fine in Windows (of course) and on my Ubuntu partition. I recently installed Debian because Ubuntu runs pretty slow on my laptop, but I can't get that controller to work in Debian. It doesn't even seem to be detecting the joystick. help please?
USB is still a bit of a black art, I've found... What is the output of Code: Select alllsusb when the thing is plugged in? Also do Code: Select alldpkg -l usb* to see what usb-related apps are available/installed For example, usbview is a handy gui tool to examine the various usb devices attached to the system at any given time.
Hello everybody ! I have a problem making my webcam work in debian... I've read a lot of forum posts but nothin' worked ... I'm using debian testing with kernel 2.6. 2.6.15-1-686-smp The webcam is a creative webcam (seems to use ov511 driver and recognized as a ov518) I installed gqcam, the command gqcam -v /dev/video0 returns : "/dev/video0: Function not implemented" I loaded videodev ovcamchip and ov511 compress=1 modules as I read on a forum... here's the console output returned by grep | dmesg ov5 : drivers/usb/media/ov511.c: USB OV518 video device found drivers/usb/media/ov511.c: Device revision 17 drivers/usb/media/ov511.c: Sensor is an OV6620 drivers/usb/media/ov511.c: Device at usb-0000:00:1d.3-1 registered to minor 0 usbcore: registered new driver ov511 drivers/usb/media/ov511.c: v1.64 for Linux 2.5 : ov511 USB Camera Driver drivers/usb/media/ov511.c: No decompressor available drivers/usb/media/ov511.c: No decompressor available drivers/usb/media/ov511.c: No decompressor available drivers/usb/media/ov511.c: No decompressor available note : i tried to load pwc driver too.... note : i tried to load ov511 module without compress=1 too... note : using udev, kde with dual display on ATI,(all full suported) Please someone rescue me ! I have to boot under windows just to be able to have videoconference and i'm scared of the windows logo displayed on my screen lol! Thanks a lot for your time... ask for any additional infos... -simon
I can't help specifically, but perhaps I can offer a few ideas... Which version of the driver are you using? For the OV6620 senser you'll need the later 2.x series. Check the permissions on your /dev/video0 (you need r+w permission) There may be a problem if you're using a newer version of gcc than the kernel was compiled with. And here is a tidbit poorly translated from french using babelfish: Note: With cool thing to C is to cuts the ov519_decomp loaded after each time you load the ov51x module. With kernels 2.6, it is really easy: all you cuts to C is to could has text file At /etc/modprobe.d that has this line: ' install ov51x /sbin/modprobe -- is unaware of-install ov51x; /sbin/modprobe ov519_decomp'. To C so, just C the following things: # echo "install ov51x /sbin/modprobe -- is unaware of-install ov51x; /sbin/modprobe ov519_decomp "\ > /etc/modprobe.d/ov51x # update-modules (The \ is only to tell that the two lines cuts to Be typed in A row.. It would not drank made the here page wink ) Note: To work around the kopete for KDE 3.5 green image bug, you should add this parameter: /sbin/modprobe -- is unaware of-install ov51x force_palette=13, see FAQ for more details. Note: Here, debian sid, this does No to skirt seems to work.. Instead it worked adding the same line to /etc/modprobe.conf
I have been trying to install the FGLRX drivers for my computer, following the instructions here: http://wiki.cchtml.com/index.php/Debian ... tion_Guide. However, when I try to use dpkg to install fglrx-driver_8.24.8-1_i386.deb I get this error: Code: Select alldpkg: dependency problems prevent configuration of fglrx-driver: fglrx-driver depends on xserver-xorg (<< 7.0.99); however: Version of xserver-xorg on system is 1:7.0.20. dpkg: error processing fglrx-driver (--install): dependency problems - leaving unconfigured Errors were encountered while processing: fglrx-driver This happens with either the FGLRX version the wiki suggests ( 8.24.8 ) or the latest from ATI ( 8.25.18 ). What really bothers me is that I did this successfully about a week ago; has the Xorg version been reverted since then? I am running 32bit Etch, and if anyone could help me get FGLRX running again that would be great.
The epoch has been changed from 0 to 1, this breaks the driver package.
I'm currently running 2 Ultra 133 TX2 Promise controller cards, I cannot seem to get both of them to work at the same time under debian, they were confirmed working under gentoo so I know they "should" work ^^. So far I have tested the cables, the pci slots, the cards and the bios on the cards, the hdd's and they all come out fine. In all cases the first card detected will let me access the hdd's but the second one detected will not. The drives do show up under /dev and in dmesg but are totally unaccesable. this is from my logs : Jan 1 00:02:22 localhost kernel: SIS5513: IDE controller at PCI slot 0000:00:00.1 Jan 1 00:02:22 localhost kernel: SIS5513: chipset revision 208 Jan 1 00:02:22 localhost kernel: SIS5513: not 100%% native mode: will probe irqs later Jan 1 00:02:22 localhost kernel: SIS5513: SiS530 ATA 66 controller Jan 1 00:02:22 localhost kernel: ide0: BM-DMA at 0x4000-0x4007, BIOS settings: hda:DMA, hdb:DMA Jan 1 00:02:22 localhost kernel: ide1: BM-DMA at 0x4008-0x400f, BIOS settings: hdc:DMA, hdd:DMA Jan 1 00:02:22 localhost kernel: hdb: QUANTUM FIREBALL CX10.0A, ATA DISK drive Jan 1 00:02:22 localhost kernel: Using anticipatory io scheduler Jan 1 00:02:22 localhost kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Jan 1 00:02:22 localhost kernel: hdb: max request size: 128KiB Jan 1 00:02:22 localhost kernel: hdb: 19541088 sectors (10005 MB) w/418KiB Cache, CHS=19386/16/63, UDMA(33) Jan 1 00:02:22 localhost kernel: /dev/ide/host0/bus0/target1/lun0: p1 p2 < p5 > Jan 1 00:02:22 localhost kernel: PDC20269: IDE controller at PCI slot 0000:00:09.0 Jan 1 00:02:22 localhost kernel: PCI: Found IRQ 11 for device 0000:00:09.0 Jan 1 00:02:22 localhost kernel: PDC20269: chipset revision 2 Jan 1 00:02:22 localhost kernel: PDC20269: ROM enabled at 0xe4000000 Jan 1 00:02:22 localhost kernel: PDC20269: 100%% native mode on irq 11 Jan 1 00:02:22 localhost kernel: ide2: BM-DMA at 0xc000-0xc007, BIOS settings: hde:pio, hdf:pio Jan 1 00:02:22 localhost kernel: ide3: BM-DMA at 0xc008-0xc00f, BIOS settings: hdg:pio, hdh:pio Jan 1 00:02:22 localhost kernel: hde: WDC WD2500JB-50FUA0, ATA DISK drive Jan 1 00:02:22 localhost kernel: hdf: WDC WD1000BB-32CAA0, ATA DISK drive Jan 1 00:02:22 localhost kernel: ide2 at 0xb000-0xb007,0xb402 on irq 11 Jan 1 00:02:22 localhost kernel: hde: max request size: 1024KiB Jan 1 00:02:22 localhost kernel: hde: 488397168 sectors (250059 MB) w/8192KiB Cache, CHS=30401/255/63, UDMA(100) Jan 1 00:02:22 localhost kernel: /dev/ide/host2/bus0/target0/lun0: p1 Jan 1 00:02:22 localhost kernel: hdf: max request size: 128KiB Jan 1 00:02:22 localhost kernel: hdf: 195371568 sectors (100030 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100) Jan 1 00:02:22 localhost kernel: /dev/ide/host2/bus0/target1/lun0: p1 Jan 1 00:02:22 localhost kernel: PDC20269: IDE controller at PCI slot 0000:00:0d.0 Jan 1 00:02:22 localhost kernel: PCI: Found IRQ 5 for device 0000:00: 0d.0 Jan 1 00:02:22 localhost kernel: PDC20269: chipset revision 2 Jan 1 00:02:22 localhost kernel: PDC20269: ROM enabled at 0xe5000000 Jan 1 00:02:22 localhost kernel: PDC20269: 100%% native mode on irq 5 Jan 1 00:02:22 localhost kernel: ide4: BM-DMA at 0xd800-0xd807, BIOS settings: hdi:pio, hdj:pio Jan 1 00:02:22 localhost kernel: ide5: BM-DMA at 0xd808-0xd80f, BIOS settings: hdk:pio, hdl:pio Jan 1 00:02:22 localhost kernel: hdi: Maxtor 6L250R0, ATA DISK drive Jan 1 00:02:22 localhost kernel: hdj: WDC WD2500JB-50FUA0, ATA DISK drive Jan 1 00:02:22 localhost kernel: ide4 at 0xc800-0xc807,0xcc02 on irq 5 Jan 1 00:02:22 localhost kernel: hdi: max request size: 1024KiB Jan 1 00:02:22 localhost kernel: hdi: 490234752 sectors (251000 MB) w/16384KiB Cache, CHS=30515/255/63, UDMA(133) Jan 1 00:02:22 localhost kernel: /dev/ide/host4/bus0/target0/lun0: p1 Jan 1 00:02:22 localhost kernel: hdj: max request size: 1024KiB Jan 1 00:02:22 localhost kernel: hdj: 488397168 sectors (250059 MB) w/8192KiB Cache, CHS=30401/255/63, UDMA(100) Jan 1 00:02:22 localhost kernel: /dev/ide/host4/bus0/target1/lun0: p1 Jan 1 00:02:22 localhost kernel: hdk: Maxtor 4A250J0, ATA DISK drive Jan 1 00:02:22 localhost kernel: hdl: WDC WD600BB-32BSA0, ATA DISK drive Jan 1 00:02:22 localhost kernel: ide5 at 0xd000-0xd007,0xd402 on irq 5 Jan 1 00:02:22 localhost kernel: hdk: max request size: 1024KiB Jan 1 00:02:22 localhost kernel: hdk: 490234752 sectors (251000 MB) w/2048KiB Cache, CHS=30515/255/63, UDMA(133) Jan 1 00:02:22 localhost kernel: /dev/ide/host4/bus1/target0/lun0: p1 Jan 1 00:02:22 localhost kernel: hdl: max request size: 128KiB Jan 1 00:02:22 localhost kernel: hdl: 117231408 sectors (60022 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100) Jan 1 00:02:22 localhost kernel: /dev/ide/host4/bus1/target1/lun0: p1 Jan 1 00:02:22 localhost kernel: kjournald starting. Commit interval 5 seconds Jan 1 00:02:22 localhost kernel: EXT3-fs: mounted filesystem with ordered data mode. Jan 1 00:02:22 localhost kernel: Adding 433712k swap on /dev/hdb5. Priority:-1 extents:1 Jan 1 00:02:22 localhost kernel: EXT3 FS on hdb1, internal journal datagod:/# ls /proc/ide/ drivers hdb hde hdf hdi hdj hdk hdl ide0 ide2 ide4 ide5 pdcnew sis I am currrently running the debian kernel 2.6.8-3-386 the errors I get from the drives when trying ot access them are datagod:/var/log# fdisk /dev/hdi Unable to open /dev/hdi and when I try to mount them datagod:/home/anime/anime# mount /dev/hdi animeI mount: you must specify the filesystem type but like I said if I switch the controller cards it's still always the first one hit that works and the second just doesn't let me access
solved it, after checking all the nodes and the logs, the default debian devfs thing does not work nor handle properlly with multiple controller cards (I have not tested this with other cards but me and everyone else who helped got this up) to fix the problem install udev for a small link on a how-to: http://glasnost.beeznest.org/articles/186
I have a Gateway laptop with a ati M7 graphics card. I am using, or rather trying to use, the radeon driver to accelerate my graphics card. All I'm able to get out of it is about 250 glxgears fps. Thanks to the dri troubleshooting guide I found my problem: http://dri.freedesktop.org/wiki/DriTroubleshooting when I turned on verbos debuging for libGL, and ran glxinfo this is what I got: Code: Select allname of display: :0.0 libGL error: dlopen /usr/lib/dri/r200_dri.so failed (/usr/lib/dri/r200_dri.so: undefined symbol: _glapi_add_dispatch) libGL error: unable to find driver: r200_dri.so libGL error: dlopen /usr/lib/dri/r200_dri.so failed (/usr/lib/dri/r200_dri.so: undefined symbol: _glapi_add_dispatch) libGL error: unable to find driver: r200_dri.so display: :0 screen: 0 direct rendering: No server glx vendor string: SGI server glx version string: 1.2 server glx extensions: GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_hyperpipe, GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig client glx vendor string: ATI client glx version string: 1.3 client glx extensions: GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_ATI_pixel_format_float, GLX_ATI_render_texture GLX version: 1.2 GLX extensions: GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_ARB_multisample OpenGL vendor string: Mesa project: www.mesa3d.org OpenGL renderer string: Mesa GLX Indirect OpenGL version string: 1.2 (1.5 Mesa 6.4.1) OpenGL extensions: GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_texture_border_clamp, GL_ARB_texture_cube_map, GL_ARB_texture_env_add, GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3, GL_ARB_transpose_matrix, GL_EXT_abgr, GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_env_add, GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_lod_bias glu version: 1.3 glu extensions: GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat ---------------------------------------------------------------------- 0x23 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 1 0 None 0x24 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 1 0 None 0x25 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 1 0 Slow 0x26 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 1 0 Slow 0x27 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 1 0 None 0x28 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 1 0 None 0x29 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 1 0 Slow 0x2a 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 1 0 Slow 0x2b 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 1 0 None 0x2c 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 1 0 None 0x2d 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 1 0 Slow 0x2e 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 1 0 Slow 0x2f 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 1 0 None 0x30 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 1 0 None 0x31 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 1 0 Slow 0x32 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 1 0 Slow Doing a little more digging, I came accross this page: http://wiki.debian.org/Xorg69To7#head-9 ... 4bce0cc294 and I tried the things suggested there for solving similar problems with i810 cards. None of my efforts have gotten me anywere. I am running debian testing, and I am starting to get to the end of my rope on this one. Could someone please give me some help. Thanks
Code: Select allOpenGL vendor string: Mesa project: www.mesa3d.org OpenGL renderer string: Mesa GLX Indirect OpenGL version string: 1.2 (1.5 Mesa 6.4.1) Code: Select alllibGL error: dlopen /usr/lib/dri/r200_dri.so failed (/usr/lib/dri/r200_dri.so: undefined symbol: _glapi_add_dispatch) libGL error: unable to find driver: r200_dri.so libGL error: dlopen /usr/lib/dri/r200_dri.so failed (/usr/lib/dri/r200_dri.so: undefined symbol: _glapi_add_dispatch) libGL error: unable to find driver: r200_dri.so Have you recompiled the DRI driver since upgrading XOrg? From what it seems there are some missing symbols or something. Also are all your GL libraries up to date?
Hi all I've just used the Etch installer (2.6.12) from the netboot cd to install Debian on my new computer. It's got an ASUS A8N-VM CSM motherboard, and a Seagate SATA 7200.9 hard disk drive. When installing, it couldn't detect the disk automatically, but it worked fine once I'd told it to use the sata_nv module. The rest of the installer went without a hitch, and I've now rebooted. When starting the system, it encounters a kernel panic: Code: Select allpivot_root: No such file or directory /sbin/init: 432: cannot open dev/console: No such file Kernel panic - not syncing: Attempted to kill init! There's quite a bit more above that too, but I'm typing it out by hand as I can't get into the system. Let me know if more detail is needed, but I can only read the last screenful. I've also tried adding this line to the GRUB booting commands, between the "kernel" and "initrd" lines: Code: Select allmodule /lib/modules/2.6.12-1-amd64-generic/kernel/drivers/scsi/sata_nv.ko ...and I've tried this too (note the "lib64")... Code: Select allmodule /lib64/modules/2.6.12-1-amd64-generic/kernel/drivers/scsi/sata_nv.ko ...but neither of them made any difference. Does anyone know what to do to solve this? Somebody must've installed successfully on this motherboard! Thanks!
try debian etchamd64 lists and nvnews forums for news and tips. Good luck.
Hello there i am running etch (including a cool kde 3.5 and a 2.6.15-1 kernel) and really, really like it but here is the issue; i have a nvidia mx440 geforce 4 64 mb card. Before etch, (when i was running xandros 2.0, ubuntu 5.04-5.10, debian sarge et al.) and needed an nvidia driver i was either downloading the nvidia-glx package+dependencies or getting headers for my kernel the build-essentials and fakeroot packages and then compiling the tar.gz driver form nvidia website. Now with etch and the default 2.6.15-1 kernel and the transition to Xorg, nvidia glx does not apply; it is not installable via synaptic due to dependency problems the default libmesa driver is supposed to replace it but 3d acceleration is not good (enen 3d billard is very slow) so i was wandering if there is any way getting round it apologies for the lenghty post Regards
Download the driver from http://www.nvidia.com/content/drivers/drivers.asp and install it(you will need kernel headers(linux-headers-2.6.15)).
Code: Select all$ cat file.txt word4 word2 word4 word2 word3 word1 word1 word3 $ How can I please get this output from file.txt ? Code: Select allword1 word2 word3 word4
Code: Select alltr " " " " < file.txt | sort -u
Hello, I'm using Debian Bookworm 12.5 amd64 (last updated today). I'm trying to download the log generated by buildd (Debian build daemon) for the Debian package linux-signed-amd64 for Debian Bookworm. These are the existing packages in Debian repositories for linux-signed-amd64: Code: Select all$ rmadison linux-signed-amd64 linux-signed-amd64 | 4.19.235+1 | oldoldstable | source linux-signed-amd64 | 4.19.249+2 | oldoldstable | source linux-signed-amd64 | 5.10.127+2~bpo10+1 | buster-backports | source linux-signed-amd64 | 5.10.197+1 | oldstable | source linux-signed-amd64 | 5.10.209+2 | oldstable | source linux-signed-amd64 | 6.1.55+1~bpo11+1 | bullseye-backports | source linux-signed-amd64 | 6.1.66+1 | stable | source linux-signed-amd64 | 6.1.67+1 | stable-updates | source linux-signed-amd64 | 6.1.69+1~bpo11+1 | bullseye-backports | source linux-signed-amd64 | 6.1.76+1~bpo11+1 | backports-policy | source linux-signed-amd64 | 6.1.76+1 | stable | source linux-signed-amd64 | 6.1.82+1 | proposed-updates | source linux-signed-amd64 | 6.1.85+1 | proposed-updates | source linux-signed-amd64 | 6.5.3+1~bpo12+1 | stable-backports | source linux-signed-amd64 | 6.5.10+1~bpo12+1 | stable-backports | source linux-signed-amd64 | 6.6.13+1~bpo12+1 | stable-backports | source linux-signed-amd64 | 6.6.15+2 | testing | source linux-signed-amd64 | 6.7.12+1 | buildd-unstable | source linux-signed-amd64 | 6.7.12+1 | unstable | source According to the "Debian Package Auto-Building" web page [1], I could use the getbuildlog [2] utility (from the devscripts package): Download build logs Install getbuildlog: sudo apt install devscripts Download linux-signed-amd64 6.1.82+1 amd64 build log: getbuildlog linux-signed-amd64 6.1.82+1 amd64 Download all linux-signed-amd64 6.1.82+1 build logs: getbuildlog linux-signed-amd64 6.1.82+1 Download latest linux-signed-amd64 amd64 build log: getbuildlog linux-signed-amd64 "last" amd64 Download all linux-signed-amd64 amd64 build logs: getbuildlog linux-signed-amd64 "" amd64 Download latest linux-signed-amd64 build logs: getbuildlog linux-signed-amd64 last Download all linux-signed-amd64 build logs: getbuildlog linux-signed-amd64 The following command successfully downloads all build logs: Code: Select all$ getbuildlog linux-signed-amd64 On the contrary, the following command do not download the buildd log for the 6.1.82+1 version: Code: Select all$ getbuildlog linux-signed-amd64 6.1.82+1 amd64 Analysing the script running, this is its output: Code: Select all$ bash -x getbuildlog linux-signed-amd64 6.1.82+1 amd64 + set -e + PROGNAME=getbuildlog + '[' linux-signed-amd64 = -h ']' + '[' linux-signed-amd64 = --help ']' + '[' linux-signed-amd64 = -V ']' + '[' linux-signed-amd64 = --version ']' + '[' 3 -ge 1 ']' + '[' 3 -le 3 ']' + which wget + PACKAGE=linux-signed-amd64 + VERSION=6.1.82+1 + ARCH=amd64 ++ echo linux-signed-amd64 ++ sed -e 's/\+/\\\+/g' + ESCAPED_PACKAGE=linux-signed-amd64 + GET_LAST_VERSION=no + '[' 6.1.82+1 = last ']' + '[' 6.1.82+1 = last-all ']' + PATTERN='fetch\.(cgi|php)\?pkg=linux-signed-amd64&arch=amd64&ver=6.1.82+1&stamp=[[:digit:]]+' + getbuildlog https://buildd.debian.org + BASE=https://buildd.debian.org ++ mktemp --tmpdir getbuildlog.tmp.XXXXXXXXXX + ALL_LOGS=/tmp/getbuildlog.tmp.u6G4nlCLNz + wget -q -O /tmp/getbuildlog.tmp.u6G4nlCLNz 'https://buildd.debian.org/status/logs.php?pkg=linux-signed-amd64' + sed -i -e 's/href="/ href="/g' /tmp/getbuildlog.tmp.u6G4nlCLNz + sed -i -e 's/&amp;/\&/g' -e 's/%2B/\+/g' -e s/%3A/:/g -e s/%7E/~/g /tmp/getbuildlog.tmp.u6G4nlCLNz + '[' no '!=' no ']' + NEWPATTERN='fetch\.(cgi|php)\?pkg=linux-signed-amd64&arch=amd64&ver=6.1.82+1&stamp=[[:digit:]]+' ++ grep -E -o 'fetch\.(cgi|php)\?pkg=linux-signed-amd64&arch=amd64&ver=6.1.82+1&stamp=[[:digit:]]+' /tmp/getbuildlog.tmp.u6G4nlCLNz + '[' no = yes ']' Therefore, the following regex expression does not match any lines in the list of buildd logs available at https://buildd.debian.org/status/logs.php?pkg=linux-signed-amd64: Code: Select allPATTERN='fetch\.(cgi|php)\?pkg=linux-signed-amd64&arch=amd64&ver=6.1.82+1&stamp=[[:digit:]]+' [..] grep -E -o 'fetch\.(cgi|php)\?pkg=linux-signed-amd64&arch=amd64&ver=6.1.82+1&stamp=[[:digit:]]+' /tmp/getbuildlog.tmp.u6G4nlCLNz [..] It turns out that the regex fails because of the '+' character (which is interpreted as a regex expression, not a character); the regex expression that matches the log name is (note the double back slash to escape the '+' character): Code: Select allgrep -E -o 'fetch\.(cgi|php)\?pkg=linux-signed-amd64&arch=amd64&ver=6.1.82\\+1&stamp=[[:digit:]]+' /tmp/getbuildlog.tmp.u6G4nlCLNz Therefore, the command should be: Code: Select all$ getbuildlog linux-signed-amd64 6.1.82\\+1 amd64 --2024-04-26 15:52:45-- https://buildd.debian.org/status/fetch.php?pkg=linux-signed-amd64&arch=amd64&ver=6.1.82%2B1&stamp=1712000451&raw=1 Resolving buildd.debian.org (buildd.debian.org)... 209.87.16.60, 2607:f8f0:614:1::1274:60 Connecting to buildd.debian.org (buildd.debian.org)|209.87.16.60|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/plain] Saving to: 'linux-signed-amd64_6.1.82+1_amd64.log' linux-signed-amd64_6.1.82+1_amd [ <=> ] 1.81M 1.59MB/s in 1.1s 2024-04-26 15:52:48 (1.59 MB/s) - 'linux-signed-amd64_6.1.82+1_amd64.log' saved [1894891] or more precisely: Code: Select allgetbuildlog linux-signed-amd64 6\\.1\\.82\\+1 amd64 Am I missing something ? What could be changed in the getbuildlog script [2] to help fix this and contribute to the Debian project? -- [1] Debian Package Auto-Building [2] getbuildlog.sh
Hello @fabien, I apologize for not replaying in a short time. fabien wrote: 2024-04-26 21:48 What I think is a bug is on line 76: Code: Select allESCAPED_PACKAGE=$(echo "$PACKAGE" | sed -e 's/\+/\\\+/g') "." must also be protected in package names. Since it's a shell script, it's easy to have a modified version in /usr/local/bin/. I can propose "protected-patterns-getbuildlog" which keeps the default behaviour by default but automatically protects version patterns when using the -p switch. [..] Code: Select all$> diff /usr/bin/getbuildlog /usr/local/bin/pp-getbuildlog 44a45,47 > # Same as above but automatically protect version: > $PROGNAME -p hello 2.2-1 amd64 > 59a63 > This version 2024 of1_À_disroot_POINT_org GPLv3+ 62a67,69 > ### -p automatically protects versions (treated as patterns by default) > [ "$1" = "-p" ] && { shift; PROTECTEDPTRN="true"; } || PROTECTEDPTRN="false" > 76c83,84 < ESCAPED_PACKAGE=$(echo "$PACKAGE" | sed -e 's/\+/\\\+/g') --- > ### protect + AND . > ESCAPED_PACKAGE=$(echo "$PACKAGE" | sed -e 's/\.\|\+/\\&/g') 84a93,94 > elif "$PROTECTEDPTRN" && [ "$VERSION" != "[:~+.[:alnum:]-]+" ]; then > VERSION=$(echo "$VERSION" | sed -e 's/\.\|\+/\\&/g') Thank you so much for your insights. If I understand correctly, line 76 only affects the name of the package (escaping the "+" sign), but not the "+" or "." characters in the package's version string: Code: Select allESCAPED_PACKAGE=$(echo "$PACKAGE" | sed -e 's/\+/\\\+/g') Following your insights, the original getbuildlog script fails because of the package's version argument: the "." and "+" are not escaped, therefore in the script's regex the first is interpreted as a "metacharacter", the second as a "quantifier", both not as character); i.e. the following commands fail: Code: Select all$ getbuildlog linux-signed-amd64 6.1.67+1 $ getbuildlog linux-signed-amd64 "6.1.67+1" Otherwise, the following command succeeds because in the regular expression "6.1.67\+1" the character "." is interpreted as metacharacter (that matches every other character; note: possible side effects), but "\+" as a character: Code: Select all$ getbuildlog linux-signed-amd64 "6.1.67\+1" Therefore, the complete command working command with the original script should be: Code: Select all$ getbuildlog linux-signed-amd64 "6\.1\.67\+1" So I thought another possible change to the original script might be (full script attached): Code: Select all$ diff -u /bin/getbuildlog my_getbuildlog.sh --- /bin/getbuildlog 2023-10-20 18:54:42.000000000 +0200 +++ my_getbuildlog.sh 2024-05-01 00:53:21.419765425 +0200 @@ -82,8 +82,11 @@ elif [ "$VERSION" = "last-all" ]; then GET_LAST_VERSION=all VERSION=[:~+.[:alnum:]-]+ +else + VERSION=$(echo "$VERSION" | sed 's/\.\|\+/\\&/g') fi PATTERN="fetch\.(cgi|php)\?pkg=$ESCAPED_PACKAGE&arch=$ARCH&ver=$VERSION&\ stamp=[[:digit:]]+" This way the script works also without quoting or escaping "." and "+" characters; i.e.: Code: Select all$ bash ./my_getbuildlog.sh linux-signed-amd64 6.1.67+1 Therefore command format for version argument could be compatible with the commands cited in the footer of Debian buildd page [1], but the manual page of the command should be modified. I cannot see now if there are other side effects. What do you think about it ? --- my_getbuildlog.sh.zip (2.27 KiB) Downloaded 63 times -- [1] buildd page
I wrote a program by custom built of GMP 6.3.0 for GDB debugging .... I wrote the app and then compiled by : Code: Select allgcc -g -o ~/program ~/program.c -lgmp -L/usr/local/lib/libgmp.a and then created a core dump file because of my segfault error .... A " core " file created ..... I edited my code and compiled it again and for making sure the new " core " file will be created I erased the former one ....... And then tried again but Terminal showed " No such file or directory " ..... I tried to execute my own written program , But faced with " No such file or directory " ..... I searched web for error and I found 2 useful commands ldd : Code: Select allldd ~/program linux-vdso.so.1 (0x00007ffc8cfaf000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0e44674000) /lib64/ld-linux-x86-64.so.2 (0x00007f0e448c6000) and file : Code: Select allfile ~/program /home/lovelorn/program: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=fda5dc6c7ee58c836d52154e6fb344ef25bedd4e, for GNU/Linux 3.2.0, with debug_info, not stripped Both show no problem but I still have the problem ...... Can anyone help ? Thanks
Hello @Hadi_Lovelorn , Hadi_Lovelorn wrote: 2024-08-16 10:35 I replaced -g with -ggdb and it compiled and linked .... GDB runs "program" but still has same error ; When I type ~/program in Terminal , It warns " No such file or directory found " Do you think it is possible that the "No such file or directory found" message from your "program" means that it cannot find the file or directory it is trying to access, or that the file/directory name in the program is wrong so that the "program" cannot access it ? -- notes: 1) moved to "Programming" sub-forum. 2) "commands file and ldd" (from the subject) seems irrelevant to the topic
Hello. I want to try to use python library PyPasser, which is not in Debian, but it is in PyPi. My script also use simplejson, which is in Debian repository. When I run pipenv in directory of script, I got no error or warning: Code: Select all$ pipenv install PyPasser Installing PyPasser... Installing dependencies from Pipfile.lock (b4c779)... To activate this project's virtualenv, run pipenv shell. Alternatively, run a command inside the virtualenv with pipenv run. But when I want to run script, I get error (name of directory is filtered by me): Code: Select all$ pipenv run python3 ./produkty.py Traceback (most recent call last): File "/home/ruwolf/<filtered>/produkty.py", line 20, in <module> from simplejson.errors import JSONDecodeError as simpleJSONDecodeError ModuleNotFoundError: No module named 'simplejson' It is the same, when I run it in shell. Code: Select all$ python3 --version Python 3.11.2 Code: Select all$ pipenv --version pipenv, version 2022.12.19 Code: Select all$ pip --version pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11) Code: Select all$ virtualenv --version virtualenv 20.17.1+ds from /usr/lib/python3/dist-packages/virtualenv/__init__.py What could be wrong? And how can I solve it? P.S. I have found the same error on AskUbuntu or similar page, somebody has recommend to install python3-distutils and python3-apt, but I have them, too; I have installed also python3-distutils-extra.
Hi! I'm not sure about how pipenv work, but what happen if you create a virtualenv and then, in the virtual environment install the PyParsser I mean: Code: Select all$ python3 -m venv venv $ source venv/bin/activate $ pip install PyParsser $ python yourscript.py
Low priority, but for curiosity's sake, I occasionally want to know what has changed when I upgrade my system and would like to have a terse aliased option to knock it out. I started writing it out and figured I'd see if anyone else had any suggestions before I get too deep into it. Where I stand now, the results are returned, but each as individual commands' entire changelog, and each command's changelog being opened separately: Code: Select allsudo apt-get upgrade -s|rg -A1 following|rg -0v following|awk '{print $2,$3,$4,$5,$6,$7,$8,$9,$10}'|xargs -n1 apt changelog I'd like to have only the first 4-5 lines of each changelog, all consolidated into one document in standard output (For an even lower priority, how can I print all the results in awk >= 2 instead of manually hardcoding it?
Hello, What about Package: apt-listchanges (3.24) ?
Hi, I've tried to use Tkinter with Debian. My program was really short: Code: Select allimport tkinter I've used the command python3 test2.py to run it with Python. It is the output: Code: Select alluser@debian:~/Documents$ python3 test2.py Traceback (most recent call last): File "/home/user/Documents/test2.py", line 1, in <module> import tkinter File "/home/user/Documents/tkinter.py", line 1 Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux ^ SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers Programs without tkinter haven't done any problems. Do you have any idea what is wrong?
You have a file tkinter.py in the same directory where you call your test2.py ("/home/user/Documents/tkinter.py"). So instead of the library tkinter, python imports you local file tkinter.py. And I think tkinter.py contains some output from a python interpreter start "Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux".
Hello Dears I reversed the order of my code as : Code: Select all #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> #include <gmp.h> int main(void) { FILE * fr, * fw; char filename[201]; unsigned long int size = 0; unsigned long int rt = 999999; unsigned char ch[1] = {112}; printf("Enter filename : "); fgets(filename, 200, stdin); filename[strlen (filename) - 1] = '\0'; fr = fopen(filename, "rb+"); if (fr == NULL) { fprintf(stderr, "Error during opening of file %s ", filename); perror(""); return 1; } fseek(fr, 0L, SEEK_END); size = ftell(fr); fseek(fr, 0L, SEEK_SET); if (size == -1) { fprintf(stderr, "Size doesn't match '"); perror(""); return 1; } if ( size > SIZE_MAX) { fprintf(stderr, "The size of file is greater than acceptable "); perror(""); return 1; } unsigned char * buf = NULL; buf = malloc((size_t)size); if(buf == NULL) { fprintf(stderr, "Buffer failure "); perror(""); return 1; } int r; r = fread(buf, size, 1, fr); printf("%d ", r); if (ferror(fr)) { fprintf(stderr, "Error during reading from file %s ", filename); perror(""); fclose(fr); return 1; } fclose(fr); fr = NULL; mpz_t x; mpz_init(x); mpz_t y; mpz_init(y); mpz_import(x, size, 1, (size_t)1u, 0, 0, buf); mpz_root (y, x, rt); int rootnum = 0; unsigned long int num = rt; do { num = num/10; ++rootnum; }while(num != 0); fw = fopen(filename, "wb+"); if(fw == NULL) printf("File can't be written '"); if(ferror(fw)) { fprintf(stderr, "Error during writing to file %s ", filename); perror(""); fclose(fw); return 1; } int w; w = fwrite(&rt, rootnum, 1, fw); printf("%d ", w); fclose(fw); fw = fopen(filename, "ab+"); if(fw == NULL) printf("File can't be written '"); if(ferror(fw)) { fprintf(stderr, "Error during writing to file %s ", filename); perror(""); fclose(fw); return 1; } fwrite(ch, 1, 1, fw); fclose(fw); memset (buf, 0u, size); mpz_export(buf, NULL, 1, (size_t)1u, 0, 0, y); printf(" Enter copied filename : "); fgets(filename, 200, stdin); filename[strlen (filename) - 1] = '\0'; fw = fopen(filename, "ab+"); if (fw == NULL) { fprintf(stderr, "Error during opening of file %s ", filename); perror(""); return 1; } fwrite(buf, mpz_sizeinbase(y, 10), 1, fw); if (ferror(fw)) { fprintf(stderr, "Error during writing to file %s ", filename); perror(""); fclose(fw); return 1; } fclose(fw); free(buf); mpz_clear(x); mpz_clear(y); return 0; } And this is what I get : Screenshot of GHex I entered a 1.1 GB file and rt is 999,999 but fwrite writes it as 44 bytes I convert it to decimal both as littleendian and bigendian but there's no true number .... Can Anyone Help ? Thnaks
Can you provide a more minimal example? Just remove all the irrelevant parts please? Also print all arguments of fwrite and show us the output. The second argument of fwrite should be number of bytes to copy, what is the purpose of that "num/10" expression? The size of "rt" is fixed, there is no need to calculate it at run time, just use sizeof()?
I want to get wine installed and am having a heck of a time. I'm trying to go at this as an actual download then install like you would with windows programs you get online. I tried to follow the directions on winehq's website and its not working. What am I doing wrong?
sudo must be supplied before the other apt commands. Why are you using a method for installation without internet access? And would it not just be easier to install wine via Debian's package wine?
I have tried to use Perl Compatible Regular Expressions (PCRE) by grep -P, also by pcre2grep and pcregrep. All have the same error. They read Latin letters with diacritics as word boundary. Some of them wrongly do not match them as lower-case letters. It should not be error of encoding, because I have set UTF-8 in all locale variables: Code: Select all$ printenv|grep -P '^L[AC]'|sort LANG=sk_SK.UTF-8 LANGUAGE=sk_SK.UTF-8 LC_ADDRESS=sk_SK.UTF-8 LC_ALL=sk_SK.UTF-8 LC_COLLATE=sk_SK.UTF-8 LC_CTYPE=sk_SK.UTF-8 LC_IDENTIFICATION=sk_SK.UTF-8 LC_MEASUREMENT=sk_SK.UTF-8 LC_MESSAGES=sk_SK.UTF-8 LC_MONETARY=sk_SK.UTF-8 LC_NAME=sk_SK.UTF-8 LC_NUMERIC=sk_SK.UTF-8 LC_PAPER=sk_SK.UTF-8 LC_RESPONSE=sk_SK.UTF-8 LC_TELEPHONE=sk_SK.UTF-8 LC_TIME=sk_SK.UTF-8 Testing file: Code: Select all$ cat diakritika.txt -čí -čia -čo -Evička -Košice -ký -mám -úži -Žiar -42úver IMHO wrong results: Code: Select all$ grep -P '\b\p{Ll}{2}' diakritika.txt -čia -Evička -Košice -ký -mám -Žiar -42úver Code: Select all$ pcregrep '\b\p{Ll}{2}' diakritika.txt -čia -Evička -Košice -Žiar -42úver Code: Select all$ pcre2grep '\b\p{Ll}{2}' diakritika.txt -čia -Evička -Košice -Žiar -42úver Versions of commands and libraries: Code: Select all$ LANG=C; grep --version grep (GNU grep) 3.11 ⋮ grep -P uses PCRE2 10.44 2024-06-07 Code: Select all$ pcregrep --version pcregrep version 8.39 2016-06-14 Code: Select all$ pcre2grep --version pcre2grep version 10.44 2024-06-07 Code: Select all$ bash --version GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu) (Of course, I have switched LANG to C after the testing, due language used in printing of versions.) grep -P and pcre2grep seem to use the same library, but they give different results; -ký & -mám are correct answers, but pcregrep & pcre2grep do not match them; -úži should be in results, but no commands match it. -Evička, -Košice, -Žiar, -42úver are all false results, because they begin by upper-case letter or digit (digits are considered to be word characters by PerlDoc.Perl.org/perlre: Character Classes and other Special Escapes). Of course, I use single letters as single UniCode characters, not composites with Combining Diacritical Marks. Do I make some error? Or is it bug in libraries (it seems to me to be improbable)?
I have found solution. You have to use both special switches: (*UCP) (UniCode Properties) & (*UTF) (for encoding); (their order is irrelevant): Code: Select all$ grep -P '(*UTF)(*UCP)\b\p{Ll}{2}' diakritika.txt -čí -čia -čo -ký -mám -úži Code: Select all$ pcregrep '(*UCP)(*UTF)\b\p{Ll}{2}' diakritika.txt -čí -čia -čo -ký -mám -úži Code: Select all$ pcre2grep '(*UCP)(*UTF)\b\p{Ll}{2}' diakritika.txt -čí -čia -čo -ký -mám -úži Source: pcre2unicode man page.
hi, I have a c program to show the linux error codes Code: Select all#include <stdio.h> #include <string.h> #include <errno.h> extern int errno; int main(void){ char *err_str; for(int i = 0; i <= 133; i++){ errno = i; err_str = strerror(errno); printf("Errno %d: %s ", errno, err_str); } return 0; } when I compile with: gcc -std=c17 -pedantic -Wall -Wextra -ggdb error_codes.c -o error_codes and test for leaks with: valgrind --leak-check=full --show-leak-kinds=all --verbose ./error_codes I get: Code: Select all==4054== HEAP SUMMARY: ==4054== in use at exit: 17 bytes in 1 blocks ==4054== total heap usage: 5 allocs, 4 frees, 1,258 bytes allocated ==4054== ==4054== Searching for pointers to 1 not-freed blocks ==4054== Checked 106,800 bytes ==4054== ==4054== 17 bytes in 1 blocks are still reachable in loss record 1 of 1 ==4054== at 0x48407B4: malloc (vg_replace_malloc.c:381) ==4054== by 0x48E4427: __vasprintf_internal (vasprintf.c:71) ==4054== by 0x48B7BD5: asprintf (asprintf.c:31) ==4054== by 0x4904A70: strerror_l (strerror_l.c:45) ==4054== by 0x109181: main (error_codes.c:24) ==4054== ==4054== LEAK SUMMARY: ==4054== definitely lost: 0 bytes in 0 blocks ==4054== indirectly lost: 0 bytes in 0 blocks ==4054== possibly lost: 0 bytes in 0 blocks ==4054== still reachable: 17 bytes in 1 blocks ==4054== suppressed: 0 bytes in 0 blocks ==4054== ==4054== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) the program executes correctly... BUT when i compile and test for leaks with: gcc -fsanitize=address -std=c17 -pedantic -Wall -Wextra -ggdb error_codes.c -o error_codes and valgrind --leak-check=full --show-leak-kinds=all --verbose ./error_codes the output is: Code: Select all==3960== HEAP SUMMARY: ==3960== in use at exit: 0 bytes in 0 blocks ==3960== total heap usage: 0 allocs, 0 frees, 0 bytes allocated ==3960== ==3960== All heap blocks were freed -- no leaks are possible ==3960== ==3960== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) Again the program executes correctly Why does the -fsanitize=address flag everything is good but without -fsanitize=address, I'm leaking memory? It is not a very important question but I'm confused as to why this is so Thanks for any suggestions in advance Safran
Hello, Can you please provide your Debian version and the compiler / C libraries / valgrind versions you used ?
Hi everybody. I am trying to import external links but it is not working anymore. This is an example of a link I am trying to retrieve https://www.investing.com/equities/gulf ... eum-ratios 1 Any way I can import? Is there a way to import a specific number from a table in the link same as I did with google sheets (=IF(NOW(),Index(IMPORTHTML(“https://www.investing.com/equities/gulf ... ,"table”,2),2,2)) I am on Debian Testing, KDE. Updated everything. I will appreciate any help to enable me to retrieve external data. Thank you in advance (P.S. I tried to search the forum, but couldn’t find solution) Version: 24.2.4.2 (X86_64) / LibreOffice Community Build ID: 420(Build:2) CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf5 (cairo+wayland) Locale: en-US (C.UTF-8); UI: en-US Debian package version: 4:24.2.4-1+b2 Calc: threaded
Moved to Offtopic as not Debian related.
I purged libgmp10-dev from Debian 12 Bookworm and then installed GMP 6.3.0 from source with debug options : Code: Select all./configure --disable-shared --enable-assert --enable-alloca=debug --host=none CFLAGS=-g I want to compile my program as : Code: Select allgcc -o -g ~/program ~/program.c -lgmp -L/usr/local/lib/libgmp.a but GCC gives error : Code: Select all/usr/bin/ld: /home/lovelorn/program: stderr: invalid version 2 (max 0) /usr/bin/ld: /home/lovelorn/program: error adding symbols: bad value collect2: error: ld returned 1 exit status How should I compile it ? and then debug it ? Before these options my program got compiled successfully but didn't run and give : segfault error .....
Hello @Hadi_Lovelorn, Hadi_Lovelorn wrote: 2024-08-07 13:14 I purged libgmp10-dev from Debian 12 Bookworm and then installed GMP 6.3.0 from source with debug options : Code: Select all./configure --disable-shared --enable-assert --enable-alloca=debug --host=none CFLAGS=-g I want to compile my program as : Code: Select allgcc -o -g ~/program ~/program.c -lgmp -L/usr/local/lib/libgmp.a but GCC gives error : Code: Select all/usr/bin/ld: /home/lovelorn/program: stderr: invalid version 2 (max 0) /usr/bin/ld: /home/lovelorn/program: error adding symbols: bad value collect2: error: ld returned 1 exit status How should I compile it ? and then debug it ? Please focus on one topic at a time. You cannot debug a program that does not yet exist as a binary file. Please change the subject of the first post from "How to use GDB for debugging GMP library-used program" to "gcc: cannot compile a program with a custom GMP library". Thanks.
I am getting this error every time I try to run something which will use GTK3. The applications work just fine but for some reason I am getting this annoying message. For example I did a simple GTK3 C application as follows, Code: Select all#include <gtk/gtk.h> static void on_destroy(GtkWidget *widget, gpointer data) { gtk_main_quit(); } const int WIDTH = 300; const int HEIGHT = 200; int main(int argc, char *argv[]) { GtkWidget *window = NULL;; GtkWidget *label = NULL; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "Hello, World!"); gtk_window_set_default_size(GTK_WINDOW(window), WIDTH, HEIGHT); label = gtk_label_new("Hello, World!"); gtk_container_add(GTK_CONTAINER(window), label); g_signal_connect(window, "destroy", G_CALLBACK(on_destroy), NULL); gtk_widget_show_all(window); gtk_main(); return 0; } The compilation and application runs ok but the following happens, Code: Select allme@pc ~/tests/cpp/gtk $ ./helloworld Gtk-Message: 20:06:44.116: Failed to load module "xapp-gtk3-module" me@pc ~/tests/cpp/gtk $ This is Code: Select allLinux: Debian GNU/Linux 12 (bookworm) 12.6 Kernel: 6.1.0-23-amd64 Nvidia: 535.183.01 GTK: 3.24.38 So what is happening and how to fix ?
Hello, I rebuilt the binary for the code of your previous message with the following commands (using a Debian 12.6 for amd64 with KDE and gtk libraries installed): Code: Select allPKGCONFIG=$(which pkg-config) CFLAGS=$($PKGCONFIG --cflags gtk+-3.0) LIBS=$($PKGCONFIG --libs gtk+-3.0) gcc -o HelloWorld HelloWorld.c $CFLAGS $LIBS The program runs fine (the "Hello World" window appears), but no error message appears (neither a command line error message nor as a graphical window). The xapp-gtk3-module is not installed in my computer: Code: Select all$ apt-file search xapp-gtk3-module libxapp-gtk3-module: /etc/X11/Xsession.d/80xapp-gtk3-module libxapp-gtk3-module: /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libxapp-gtk3-module.so libxapp-gtk3-module: /usr/share/doc/libxapp-gtk3-module/changelog.Debian.gz libxapp-gtk3-module: /usr/share/doc/libxapp-gtk3-module/changelog.gz libxapp-gtk3-module: /usr/share/doc/libxapp-gtk3-module/copyright libxapp-gtk3-module: /usr/share/lintian/overrides/libxapp-gtk3-module $ LANG=C apt list libxapp-gtk3-module Listing... Done libxapp-gtk3-module/stable 2.4.2-3 amd64 The package containing the module has the following description: Code: Select all$ apt show libxapp-gtk3-module Package: libxapp-gtk3-module Version: 2.4.2-3 Priority: optional Section: libs Source: xapp Maintainer: Debian Cinnamon Team <debian-cinnamon@lists.debian.org> Installed-Size: 39.9 kB Depends: xapps-common (>= 2.4.2-3), libglib2.0-0 (>= 2.26.0), libgtk-3-0 (>= 3.9.10), libxapp1 (>= 2.4.0) Breaks: libxapp1 (<< 2.2.6-1~), xapp (<< 2.4.2-1~), xapps-common (<< 2.4.2-1~) Replaces: libxapp1 (<< 2.2.6-1~), xapp (<< 2.4.2-1~), xapps-common (<< 2.4.2-1~) Homepage: http://cinnamon.linuxmint.com/ Tag: role::shared-lib Download-Size: 8,556 B APT-Sources: http://localhost:3142/debian bookworm/main amd64 Packages Description: GTK 3.0 module for the XApp library Xapp provides components which are common to multiple desktop environments and required to implement cross-DE solutions. . This package contains a GTK 3.0 module to make features of the XApp library available to GTK 3.0 applications. It is a dependency of: Code: Select all$ apt show libxapp1/stable Package: libxapp1 Version: 2.4.2-3 Priority: optional Section: libs Source: xapp Maintainer: Debian Cinnamon Team <debian-cinnamon@lists.debian.org> Installed-Size: 274 kB Depends: xapps-common (>= 2.4.2-3), libc6 (>= 2.4), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.2.4), libgdk-pixbuf-2.0-0 (>= 2.23.0), libglib2.0-0 (>= 2.51.5), libgnomekbd8 (>= 3.6.0), libgtk-3-0 (>= 3.21.5), libpango-1.0-0 (>= 1.14.0), libx11-6 Recommends: libxapp-gtk3-module (= 2.4.2-3), xapp-sn-watcher (= 2.4.2-3) Breaks: nemo (<< 5.2), xapps-common (<< 2.0.6-2~) Replaces: xapps-common (<< 2.0.6-2~) Homepage: http://cinnamon.linuxmint.com/ Tag: role::shared-lib Download-Size: 75.1 kB APT-Sources: http://localhost:3142/debian bookworm/main amd64 Packages Description: XApp library Xapp provides components which are common to multiple desktop environments and required to implement cross-DE solutions. . This library is used by several Xapp apps. Is the libxapp-gtk3-module installed in your computer ? Are you running cinnamon ?
Hi There I need GMP program for My own application , In the manual of GMP its making by GNU make is : ./configure make When I enter ./configure it works right and creates some files in the gmp folder in Home but when I enter make in Terminal it says there's no make file ; Here's the error : Code: Select allmake: *** No targets specified and no makefile found. Stop. And actually there's no make file in the folder ( cmake or GNU make specification file ) I will be very grateful if You guide Me to how to compile and make GMP
Moved to "Programming" sub-forum.
Why some commands written in /etc/profile are executed in tty but not in terminal emulators like Code: Select allname=amin
Check "man bash" and search for "profile": Code: Select allWhen bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists
Why some commands like startx and rmmod aren't executed in bashrc?
We don't startx from .bashrc because .bashrc is sourced every time you open a terminal window. You can starx from ~/.profile if you like. You can't rmmod as an unprivileged user, only root can remove kernel modules.
For some background, I've recently moved from Ubuntu server to Debian, something I've wanted to do for some time. The server is purely for home use, and runs Jellyfin, TVheadend and Samba. Running Debian 12 on the same hardware (TS150 Lenovo) On my previous install of Ubuntu server, I was running the following script (not written by me), which monitors for activity on various user defined ports, and shuts down after a pre-determined time idle, at which point it also writes to the time to wake for the next scheduled recording to the bios. Code: Select all#!/bin/bash # BASIC SETTINGS change at wish # Settings you have to look at # TvHeadend login and password tvh_login=YOUR_LOGIN_NAME tvh_password=YOUR_PASSWORD # (post recording) process activity to be checked, leave blank to deactivate process_check=(PROCESS_A PROCESS_B) # Settings you might look at # portnumbers to be checked for user activity (tvheadend 9981 + 9982 and samba 445) port_numbers=(9981 9982 445) # minimum time in seconds needed for consecutive shutdown AND startup safe_margin_shutdown=600 # minimum time in seconds needed to start up the computer properly safe_margin_startup=180 # minimum time in minutes not to shutdown after last user activity (watching tv/recording, up-/downloading files, booting the system) idle_time_shutdown=30 # maximum time in hours not to wake up for updating EPG epg_hours=48 # interval in seconds the script will check if the system should be shutdown script_int=60 # END OF BASIC SETTINGS keep out from here ;-) # retrieve IP_address tvheadend server tvh_ip=$(hostname -I | awk '{print $1}') # set language export LANG=C # set session start uptime_boot_sec=$(cat /proc/uptime | awk -F ' ' '{print$1}' | awk -F '.' '{print$1}') boot_time=$(($(date +%s)-uptime_boot_sec)) # initial value do not change recording=1 # check for shutdown until [ $recording -eq 0 ];do # initial values do not change recording=0 shutdown_timer=$idle_time_shutdown ping_array=() # countdown to shutdown until [ $shutdown_timer -eq 0 ];do shutdown_timer=$((shutdown_timer-1)) # check for server connection tvheadend samba or any other server according to settings above status_netstat=1 until [ $status_netstat -eq 0 ];do status_netstat=0 sleep $script_int for i in $( echo "${port_numbers[*]}"); do port_no=$i for i in $(echo $(netstat -n | grep -i "ESTABLISHED" | grep "$tvh_ip:$port_no" | awk -F ':' '{print ":"$2}' | sed 's/:'$port_no'\|[ ]//g')); do shutdown_timer=$idle_time_shutdown status_netstat=1 ping_array[$(echo "${#ping_array[*]}")]=$i done done ping_array=($(echo "${ping_array[*]}" | sed 's/[ ]/ /g' | awk '!a[$0]++' )) done for i in $(echo "${ping_array[*]}"); do if [ $( ping -c1 $i | grep "received" | awk -F ',' '{print $2}' | awk '{print $1}' ) -eq 0 ]; then ping_array=($(echo "${ping_array[*]/$i/}")) fi done if [ $(echo "${#ping_array[*]}") -eq 0 -a $boot_time -lt $(($(date +%s)-idle_time_shutdown*60)) ]; then shutdown_timer=0 fi if [ $(curl -s --user $tvh_login:$tvh_password http://127.0.0.1:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}') -ne 0 -a $shutdown_timer -eq 0 ]; then shutdown_timer=1 fi done # check for active post recording processes total_processes=0 for i in $( echo "${process_check[*]}"); do counter=$( ps -A | grep "$i" | wc -l ) total_processes=$((total_processes+counter)) done if [ $total_processes -ne 0 ]; then recording=$((recording+1)) fi # check for active users if [ $(who | wc -l) -ne 0 ]; then recording=$((recording+1)) fi # retrieve and calculate wake up data if [ $(curl -s --user $tvh_login:$tvh_password http://127.0.0.1:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}') -eq 0 ]; then wake_after_min=$((epg_hours*60)) if [ $(curl -s --user $tvh_login:$tvh_password 127.0.0.1:9981/status.xml | grep "next" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}' | wc -l) -gt 0 ]; then wake_after_min_temp=$(curl -s --user $tvh_login:$tvh_password 127.0.0.1:9981/status.xml | grep "next" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}') if [ $wake_after_min -gt $wake_after_min_temp ]; then wake_after_min=$wake_after_min_temp fi fi else wake_after_min=0 fi wake_after_secs=$((wake_after_min*60)) # check safe margin shutdown if [ $safe_margin_shutdown -gt $wake_after_secs ]; then recording=$((recording+1)) fi done # set RTC wake up time stop_date=$(date +%s) wake_date=$((stop_date+wake_after_secs-safe_margin_startup)) echo 0 > /sys/class/rtc/rtc0/wakealarm echo $wake_date > /sys/class/rtc/rtc0/wakealarm # shutdown computer sudo shutdown -h now I've used Webmin to setup the script as a systemd service to run from boot. I can confirm it's running, but it doesn't seem to work anymore. The output from "systemctl status wake.service" returns the following: Code: Select allLoaded: loaded (/lib/systemd/system/wake.service; enabled; preset: enabled) Active: active (running) since Mon 2024-04-01 19:32:50 BST; 8min ago Main PID: 443 (wake.sh) Tasks: 2 (limit: 9345) Memory: 4.1M CPU: 452ms CGroup: /system.slice/wake.service ├─ 443 /bin/bash /usr/local/bin/wake.sh └─1698 sleep 60 Apr 01 19:32:50 debian systemd[1]: Started wake.service - Auto shutdown and wake. Apr 01 19:34:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments Apr 01 19:35:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments Apr 01 19:36:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments Apr 01 19:37:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments Apr 01 19:38:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments Apr 01 19:39:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments Apr 01 19:40:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments The script is quite old, but definitely worked on the most recent version of Ubuntu sever LTS. I'm not asking for somebody to just fix this for me, but maybe explain what the differences might be between Ubuntu and Debian in terms of the way the script is executed. I've got a bit of programming experience, but not with bash, and not for some time now.
Hello, welcome to the forums! heyho wrote: 2024-04-01 19:03 Code: Select allApr 01 19:40:51 debian wake.sh[443]: /usr/local/bin/wake.sh: line 76: [: too many arguments line 76 is Code: Select allif [ $(curl -s --user $tvh_login:$tvh_password http://127.0.0.1:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}') -ne 0 -a $shutdown_timer -eq 0 ]; then A simplified code that satisfies both conditions is Code: Select allif [ 1 -ne 0 -a 0 -eq 0 ]; then echo "shutdown_timer set to 1"; fi The second condition cannot raise an error because shutdown_timer is initialized as an integer before in the code. Therefore, the reason comes from something in the first condition that may prevent this expression from generating an integer. You can simulate a similar error like this: Code: Select all$> shutdown_timer="0" $> unset testvar $> [ $testvar -ne 0 -a $shutdown_timer -eq 0 ] bash: [: too many arguments So you have to find what can trigger this error in this expression: Code: Select allcurl -s --user $tvh_login:$tvh_password http://127.0.0.1:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}' Is curl installed? Are tvh_login and tvh_password set correctly in the script? Is your local server working properly? You can test if it works: Code: Select all$> curl -s --user YOURtvh_login:YOURtvh_password http://127.0.0.1:9981/status.xml If it works, does this output a single line: Code: Select all$> curl -s --user YOURtvh_login:YOURtvh_password http://127.0.0.1:9981/status.xml | grep "subscriptions" And finally, does this output a single number: Code: Select allcurl -s --user YOURtvh_login:YOURtvh_password http://127.0.0.1:9981/status.xml | grep "subscriptions" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}' The script you are using was not designed to account for possible errors.
I created a program using qt5designer with python on Windows 10. Now I am trying to figure out how to create an installable for Windows 10. Should I use Windows or Linux to create the install application? No way can I figure out how to use pyinstaller! I have found pyinstaller instructions on the Internet but they are really confusing. Is there an easy way to create installers? Please take my migraine!! Thanks in advance.
Hello, I created a program using qt5designer with python on Windows 10. Now I am trying to figure out how to create an installable for Windows 10. Some links that might be useful: https://packaging.python.org/en/latest/overview/ https://pyinstaller.org/en/stable/ If you are targeting Windows as a deployment platform, you probably don't need Debian GNU/Linux for that.
I run Debian stable on my box and I want to install the binance connector library https://github.com/binance/binance-connector-python to query binance. I use pipx and everything seems to be OK (see below) Code: Select all$ sudo pipx install binance-connector --include-deps ⚠️ Note: normalizer was already on your PATH at /usr/bin/normalizer installed package binance-connector 3.5.1, installed using Python 3.11.2 These apps are now globally available - normalizer - wsdump ⚠️ Note: '/root/.local/bin' is not on your PATH environment variable. These apps will not be globally accessible until your PATH is updated. Run `pipx ensurepath` to automatically add it, or manually modify your PATH in your shell's config file (i.e. ~/.bashrc). done! ✨ 🌟 ✨ Then I do the following Code: Select all$ pipx ensurepath /home/lorenzo/.local/bin is already in PATH. ⚠️ All pipx binary directories have been added to PATH. If you are sure you want to proceed, try again with the '--force' flag. $ sudo pipx ensurepath [sudo] password for lorenzo: /root/.local/bin has been been added to PATH, but you need to open a new terminal or re-login for this PATH change to take effect. You will need to open a new terminal or re-login for the PATH changes to take effect. Otherwise pipx is ready to go! ✨ 🌟 ✨ and everything looks fine, but then when I open a new shell and/or relogin, I still get this Code: Select all$ python3.11 Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from binance.spot import Spot Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'binance' why is the binance library not found? Any suggestion is really appreciated and merry Xmas to everyone!
Running pipx as sudo (or root) is VERY BAD idea...
I am trying to make a custom package that would only build on arm64. I have used "sbuild-createchroot --arch=arm64 --foreign unstable /path/to/chroot/unstable-sbuild-arm64" After this completes I then try to run "/path/to/chroot/debootstrap/debootstrap --second-stage", but I get Code: Select allcat: /usr/share/debootstrap/suite: No such file or directory I don't understand what I am doing wrong here? I just want to set up sbuild so I can run "sbuild --build=arm64 --host=amd64 mypackage.dsc"
debootstrap.log says nothing more about it?
Hello bash experts, The following Code: Select all$ echo "Begin"; { sleep 10; echo "1"; } & { sleep 5; echo "2"; } & wait; echo "3"; Begin [1] 11898 [2] 11899 2 1 [1]- Done { sleep 10; echo "1"; } [2]+ Done { sleep 5; echo "2"; } 3 produces messages as expected. With Code: Select all$ echo "Begin"; { sleep 10; echo "1"; } & { sleep 5; echo "2"; } & wait 2>/dev/null; echo "3"; Begin [1] 11908 [2] 11909 2 1 3 suppress terminating messages, but I could not figure out how to suppress job start messages. The Code: Select all$ echo "Begin"; { sleep 10; echo "1" & } 2>/dev/null; { sleep 5; echo "2" & } 2>/dev/null; wait 2>/dev/null; echo "3"; Begin 1 2 3 runs 15secs (somehow "serial" execution manner?). Many thanks for any help. Leslie
Hello, an expert would probably have many interesting things to say. I can only say that Code: Select all$> echo "Begin"; { { sleep 10; echo -n "1 "; date; } & { sleep 5; echo -n "2 "; date; } & wait; } 2>/dev/null; echo "3" Begin 2 Thu Feb 1 13:51:31 CET 2024 1 Thu Feb 1 13:51:36 CET 2024 3 $> works as you expect.
I've two Debian12 servers. on is on an older physical server HP Prolian N40L and the second virtual on ProxMox. It's the same Debian12 bookworm and PHP 8.2.7 on both and the same small test.php. Tested just a simple form with 2 text-fields which are displayed on same page after clicking on submit, but it only works on the virtual server. On the physical server I see parts of the PHP code, even before clicking submit. Any suggestions? Thanks. compare
Hello @kuchenmann, welcome to the forums! Thank you for updating your topic. I'm happy you found a solution. Could you please mark your topic as [SOLVED] so other users know. To do this, change the title of your first post, e.g. [SOLVED] 2x server same PHP code but only working on one NOTE Thu Jun 6 21:42:16 CEST 2024: marked topic as solved.
Code: Select allmysql> UPDATE some_table SET some_date_column='2024-04-10' WHERE some_date_column='0000-00-00' ; ERROR 1292 (22007): Incorrect date value: '0000-00-00' for column 'some_date_column' at row 1 Server version: 8.0.26 MySQL Community Server - GPL What is please optimal solution ?
MySQL: sql_mode: NO_ZERO_DATE MariaDB: sql_mode: NO_ZERO_DATE
I am making a menu and was curious if there was a way to make it so quit was q rather than the last number. I have tried REPLY = "q" rather than Code: Select allREPLY = 1 + ${#sorted_options[@]} which did not work. I tried a case statement but was not able to get it working. The code (please steal if you find it helpful): Code: Select all#!/bin/bash ##Menu for files prompt="Please select a file to compile or run:" options=( $(cd Java_Files && find . -maxdepth 1 -type f -name "*.java") ) ##code that sorts IFS=$' ' sorted_options=($(sort <<<"${options[*]}")) unset IFS ##unset, undefines a variable PS3="$prompt " select opt in "${sorted_options[@]}" "Quit" ; do if (( REPLY = 1 + ${#sorted_options[@]} )) ; then exit elif (( REPLY > 0 && REPLY <= ${#sorted_options[@]} )) ; then echo "You picked $opt which is file $REPLY" break else echo "Invalid option. Try another one." fi done ## this grabs the file name you selected file=$opt ##This searches for the .java file to see if it exists ##This is unneeded but is here being its working code i can use in the future search_dir= "" ##put your dir here file_name=$file if [[ -d "$search_dir" ]]; then if [[ -f "$search_dir/$file_name" ]]; then echo "File $file_name exists in directory $search_dir." else echo "File $file_name does not exist in directory $search_dir." fi else echo "Directory $search_dir does not exist." fi ##This searches for the .class to see if it exists fileClass=$opt fileClass=${fileClass//.java/} fileClass+=".class" if [[ -d "$search_dir" ]]; then if [[ -f "$search_dir/$fileClass" ]]; then echo "File $fileClass exists in directory $search_dir." && classExists="y" else echo "File $fileClass does not exist in directory $search_dir." && classNotExists='y' fi else echo "" fi ##This next segment needs to be edited so if .class does not exist it compiles and then does java $file ##Compiles code if class does not exist if [[ "$classNotExists" = "y" ]]; then cd $search_dir && javac $file; sleep 1 && cd $search_dir && java $file; ##has not been tested fi ##Compiles the code if you say yes if [[ "$classExists" = "y" ]]; then echo "would you like to recompile the java code? y/n" read -r Answer fi if [[ "$Answer" =~ [yY] ]]; then cd $search_dir && javac $file; java $file fi ##Just runs the code if you say no if [[ "$Answer" =~ [nN] ]]; then cd $search_dir && java $file && java $file fi
The problem is a simple mistake: = assigns a value, == is a comparison operator. Code: Select all$> declare -i num=5 $> (( num == 6 )) || echo $num 5 $> (( num = 6 )) && echo $num 6 Code: Select all#!/bin/bash prompt="Please select a file to compile or run:" options=( "javaFile2.java" "java File1.java" "javaFile0.java" ) ### change IFS in the subshell only readarray -t sorted_options < <(IFS=$' '; sort <<<"${options[*]}") PS3="$prompt " select opt in "${sorted_options[@]}" "Quit" ; do if [[ "$REPLY" =~ ^[qQ](uit)*$ ]] || (( REPLY == 1 + ${#sorted_options[@]} )); then exit elif (( REPLY > 0 && REPLY <= ${#sorted_options[@]} )) ; then echo "You picked $opt which is file $REPLY" break else echo "Invalid option. Try another one." fi done Note that this works because non-digits are evaluated to 0 Code: Select all$> declare -i num $> myvar=w; (( myvar == 0 )) && echo myvar w $> num=w; (( num == 0 )) && echo $num 0
Hi Everybody This is a piece of code that compile as well and true by Tiny C Compiler ( tcc ) every time ..... But a week ago version of GCC was 12.2.0-14 and now 12.2.0-3 and both of them compile it wrongly and give garbage values most of times ( and correctly , some times ) . The Code : Code: Select all#include <stdio.h> int main() { FILE * fp = fopen("/home/lovelorn/Pictures/post-3.jpeg", "rb"); int n; for (int i = 0; i < 100; i++) { fread(&n, 1, 1, fp); printf("%d ", n); } fclose(fp); return 0; } You can replace the file with any file You want instead . But GCC compile and link it wrongly ...... GCC must be upgraded in Debian 12 Bookworm ...... I update and upgrade regularly ...... Can anyone report it to Debian bugs ? ( They gave me an example of bug report form but it was unclear to what I want to report )
Hadi_Lovelorn wrote: 2024-05-28 21:56 This is a piece of code […] GCC […] compile it wrongly and give garbage values most of times ( and correctly , some times ) . Some questions: What do you mean exactly with “give garbage” ? Does the compiler print “garbage” ? Does the compiled code print “garbage” ? Can you log an example of the "garbage" in a log file a report it here ?
Hi, could somebody point me to the formal explanation for this behaviour please? Code: Select all$ JUNK=$(seq 1 4) $ echo "$JUNK" 1 2 3 4 $ echo $JUNK 1 2 3 4
Moved to “Programming” sub-forum.
I have just completed a course on programming with C++. (Unfortunately, we did almost exclusively use the command line and only very briefly did extremely basic UI examples using Qt Creator. And since I prefer the look and feel of GTK+ over Qt I thought I should better learn how to create interfaces I do actually prefer.) Therefore, I want to create my first own small C++ project using GTK4. To get there, I try to work my way through the official gtkmm documentation. Unfortunately, in chapter 17 I discovered that Debian stable includes gtkmm 4.8 while some examples in the documentation need at least version 4.10 to work. I usually try to stick with the versions provided by Debian stable to keep everything reliable and simple. But since I am learning something new it doesn't seem sensible to start with learning a deprecated standard. According to my findings before GTK4 Glade was the go-to solution for creating user interfaces with GTK+ but at the moment development looks like a transitional state where Glade isn't really workable with GTK4 applications and Cambalache doesn't seem to be ready for general use yet. (So far it isn't part of Debian anyway.) I am surprised how hard it is for me to understand gtkmm. I am not sure if my current approach of trying to learn to write all necessary code for GTK4 using gtkmm by hand is a sensible approach. I have already encountered examples where I failed to adapt or combine functions from different examples. (I can't even predict what methods and properties I should expect in Glib or GTK.) I am clearly missing some foundational understanding on how concepts in GTK do really fit together and muddle through trying to understand as much as possible on the way. This isn't an approach I feel very comfortable with. Maybe I am wasting a lot of time by messing with things I shouldn't even attempt yet. Maybe GTK was not the best choice to be used in my first C++ project because it is tailored towards C and since gtkmm is only a wrapper for C++. But I have already invested weeks in it and at least by now it is probably less confusing if I stick with it. On YouTube I found someone who seems to have found a way to still use Glade to create GTK3 UI files which he then converts to GTK4. If possible I would like to avoid such a workaround. I wonder how you experienced developers out there would approach this hurdle. Do you figure it would be sensible for me as a C++ beginner to switch to Debian testing and at least get gtkmm version 4.10? Would you recommend compiling Cambalanche from code and start working with it right away? Do you know of any more basic guide for learning GTK4 GUI development with C++? Unfortunately, my track record of resolving issues by consulting the GTK documentation has not been great so far because without examples I rarely understand how exactly properties and methods even need to be written in code.
Can't actually help with gtkmm. I use Perl as my favourite programming language and there are a couple of tutorials and sample programs for GTK available in the internet. Recently, being frustrated and confused by the official documentation, I eventually asked chatGPT how this and that works and it almost always gave me well explained and running example programs. Just ask chatGPT "linux what is gtkmm". With this question (asked in German), it gave me a sample program of about 50 lines written in C++ with good explanations in English. As I don't use C, I did not try to compile it. I used glade as a GUI builder before, but for writing small tools it is way too rich and complicated and several items seem to be missing. I found it not necessary to use such tools. Writing the source code by yourself is easy enough (at least in Perl ) For me, the problems in writing GTK applications was not that much GTK itself but rather how to handle the event driven logic.
Hi, I am currently running Debian 12 Bookworm. Using Discovery, I installed Qt Creator 9.0.2, based on Qt 6.4.2 (GCC 12.2.0, X86_64). On trying to use the IDE i find that a lot of the entries in the top menus just don't show up. (I'm using the Breeze Dark theme.) A lot of the items in the menus and sub-menus are blacked out, with the (sub)menus appearing as just black rectangles. Mousing over the (sub)menus illuminates only those items that have a small right-pointing arrow head at the end of the item line. Finally, the text in the (pre-filled) text boxes shows up as black text on a slightly less black background. EDIT: One thing I forgot to mention is that, when I try to set up a "Hello World" program, the IDE gets as far as showing the dialog that allows "kits" to be selected. It appears(!) that the "Desktop" kit has been pre-selected. However, this would seem to be contradicted as the "Next" button at the bottom of this dialog is greyed out. Does anyone know why this version of Qt Creator has so much functionality missing/disabled/whatever ? Also, is there a way to install the missing kits and re-enable this missing functionality and to change the text from black to white on a black background ? Stuart
Hello, Stuarte wrote: 2024-05-30 16:12 I am currently running Debian 12 Bookworm. Using Discovery, I installed Qt Creator 9.0.2, based on Qt 6.4.2 (GCC 12.2.0, X86_64). On trying to use the IDE i find that a lot of the entries in the top menus just don't show up. (I'm using the Breeze Dark theme.) A lot of the items in the menus and sub-menus are blacked out, with the (sub)menus appearing as just black rectangles. Mousing over the (sub)menus illuminates only those items that have a small right-pointing arrow head at the end of the item line. Finally, the text in the (pre-filled) text boxes shows up as black text on a slightly less black background. [..] Does anyone know why this version of Qt Creator has so much functionality missing/disabled/whatever ? Also, is there a way to install the missing kits and re-enable this missing functionality and to change the text from black to white on a black background ? My installed qtcreator (same version of Debian and same version of qtcreator) does not show this behaviour. I'm currently using KDE as desktop environment. It might be useful to attach a screenshot to a follow-up message to demonstrate the problem.
Hello, It would be interesting to get a list of packages in Debian repositories that contain firmware files with the detail of repository content and package name. I haven't found a single command in existing packages to do this. It would also be useful to know the repository section where they are stored, as this is an indirect indication of the licence they are distributed under. Here is my 2 cents for a simple bash script to do this, based on existing commands: Code: Select all#! /bin/sh # # A simple script to list pacakges whose names contain the patter "firmware" # # It prints three columns (sorted alphabetically): # 1) repository component (main, contrib, non-free, non-free-frimware) # 2) repository section # 3) name of the package # # All repository components must be configured in /etc/apt/sources to be scanned. apt list "*firmware*" | awk -F '/' '{print $1;}' | \ while read F do apt show $F | grep "APT-Sources:" | awk -F " " '{printf("%-30s ", $3) ;}' apt show $F | grep "Section:" | awk -F " " '{printf("%-30s ", $2) ;}' echo $F done | \ sort If it is named firmware.sh, it can be called this way: Code: Select all./firmware.sh 2>/dev/null I post it here for comments, suggestions and improvements.
Hello @fabien, Thank you so much for your feedback. You have used the potential of the bash and awk languages in a very interesting way. Perhaps it would be of interest to many forum readers to briefly explain what you think is most important for the casual bash script writer. The speed optimization of the revised scripts is impressive compared to the script I originally posted (stats from time and wc commands): scriptrun timelineswordsbytes original (bash+apt+awk+grep)0m59.591s19104695 revised (bash+apt)0m1.080s291481061 revised (bash+awk)0m0.694s31991223 -- note: I suspect that the way the wc command calculates the number of words is biased because it does not interpret the code syntax.
Hi, I am trying to learn C programming making use of GTK 3. I am trying to work through the book "C and GUI Programming" 2nd edition, by Simon Long, pdf freely available from the MagPi magazine website, https://magpi.raspberrypi.com/books and published under a Creative Commons license. However, I have hit a snag with trying to get gcc to recognise GTK. When I try to compile the first small program using Code: Select allgcc gtktest.c `pkg-config --cflags --libs gtk+3.0` -o gtktest the system responds with Code: Select all$ gcc gtktest.c `pkg-config --cflags --libs gtk+3.0` -o gtktest Package gtk+3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+3.0.pc' to the PKG_CONFIG_PATH environment variable Package 'gtk+3.0', required by 'virtual:world', not found gtktest.c:1:10: fatal error: gtk/gtk.h: No such file or directory 1 | #include <gtk/gtk.h> | ^~~~~~~~~~~ compilation terminated. So far, I have learned that :- a) I need to set up some kind of .pc file to be used with the PKG_CONFIG_PATH environment variable; b) there is a gtk-3.0 folder in /usr/share; c) there is a pkgconfig foler in /usr/share. What do I place inside this .pc file ? Am I correct in thinking that I place the .pc file within /usr/share/pkgconfig folder ? I found a video on YouTube, "Understanding pkg-config command in Linux|Include and Link OpenCV header and library" but this did not show how to make changes to the PKG_CONFIG_PATH environment variable. As this is the first time that I have had to do this, could someone please point me in the direction of a good video/tutorial that will help me get this "stitching together" set up properly, including where to find this PKG_CONFIG_PATH environment variable ? Thanks, Stuart
Hello, Stuarte wrote: 2024-05-18 12:59 However, I have hit a snag with trying to get gcc to recognise GTK. When I try to compile the first small program using Code: Select allgcc gtktest.c `pkg-config --cflags --libs gtk+3.0` -o gtktest the system responds with Code: Select all$ gcc gtktest.c `pkg-config --cflags --libs gtk+3.0` -o gtktest Package gtk+3.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+3.0.pc' to the PKG_CONFIG_PATH environment variable Package 'gtk+3.0', required by 'virtual:world', not found gtktest.c:1:10: fatal error: gtk/gtk.h: No such file or directory 1 | #include <gtk/gtk.h> | ^~~~~~~~~~~ compilation terminated. [..] What do I place inside this .pc file ? Following the advice of @RedGreen925, you can list the contents of the libgtk-3-dev package. The following command will search for all files whose name ends with ".pc" in the libgtk-3-dev package : Code: Select all$ apt-file list libgtk-3-dev | grep \.pc$ libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gdk-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gdk-broadway-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gdk-wayland-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gdk-x11-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-broadway-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-unix-print-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-wayland-3.0.pc libgtk-3-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-x11-3.0.pc The file you are searching is /usr/lib/x86_64-linux-gnu/pkgconfig/gtk+-3.0.pc . Therefore, the output of the command executed as a sub-shell of the gcc command is: Code: Select all$ pkg-config --cflags --libs gtk+-3.0 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/x86_64-linux-gnu -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -pthread -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 Therefore, the gcc command needs to be rewritten as: Code: Select allgcc gtktest.c `pkg-config --cflags --libs gtk+-3.0` -o gtktest Hope this helps. Note: It seems to me that on page 79 of the book [1], the author missed the "-" character in the name of the library "gtk+-3.0" in the text of the paragraph, while the "-" is correctly displayed in the screen image on the same page. If you confirm this, it would be nice to report the typo to the author to help him fix it. -- [1] AN INTRODUCTION TO C AND GUI PROGRAMMING, 2nd Edition, Simon Long, Raspberry Pi PRESS, 2019
Hello I need to process files' data for my application , When it comes to huge data , C language can't handle them and I must write my own library for huge numbers and data but GMP is a good choice for this manner . Also I need functions for reading/writing sectors of HDD or SSD as huge amount of data for my application . I write this piece of code by GMP manual but it writes only " 0 " and as ASCII ( text ) ..... Is there any way to read/write files and sectors as binary and also my code doesn't work ( 0 as result ) : Code: Select all#include <stdio.h> #include <gmp.h> int main(void) { FILE * fr, * fw; // two file pointers prepared for creation char filename[100]; // a string for file name of input and output files printf("Enter file's name : "); scanf("%s", filename); // taking file name of input fr = fopen(filename, "rb+"); // opening file fr for reading as binary printf("Enter copied filename :"); scanf("%s", filename); // taking file name of output fw = fopen(filename, "wb+"); // opening file fw for writing as binary mpz_t x; // a big integer decalred mpz_t y; // also y mpz_init(x); // initialization of x to 0 mpz_init(y); // also y gmp_fscanf(fr, "%Zd", y); // file scanning of input file as huge decimal and store it in y mpz_set(x, y); // assigning y in x --- or should it be as a must an explicit number and not variable ? gmp_fprintf(fw, "%Zd", x); // writing x to a file mpz_clear(x); // clearing and emptying x mpz_clear(y); // also y fclose(fr); //closing fr fclose(fw); // closing fw return 0; }
It looks like you open "filename" to read ("rb+", note that "b" is ignored, so "r+" would suffice), and then immediately you open *the same file* to write ("wb+"). When you open a file for writing, the file is *truncated*, so when you then read data (anything, your issue is not specific to mpz) you get nothing. Learn C and Posix. Try first with normal integers (to avoid xy-problems), and once you get it working, switch to mpz.
Code: Select all$ foo=bar $ echo $foo bar $ foo=baz echo $foo bar $ foo=baz sh -c 'echo $foo' baz Hello! Can anybody explain to me why foo=baz echo $foo results in bar, but then it works properly when I use sh -c? Thanks!
This is an ancient question, and is answered multiple times elsewhere. It also smells suspiciously like homework... Short version: variables are evaluated (i.e. env for the child process is constructed) before the command-line is executed, unless they are protected by single quotes. This applies also to builtins like echo. LinuxOS wrote: 2023-11-28 02:39it works properly when I use sh -c? There's nothing "improper" about the first result, it's expected (though arguably somewhat confusing) behaviour. You'll find shells other than bash do this as well.
Bookworm. (Edit: xgettext has the same issue in my another box installed with bullseye too.) I am not sure since when xgettext started to unable to recognize C++. Command xgettext -C -o t.pot -f main.cpp prints the following error: xgettext: error while opening "static int caught_signal=-1;" for reading: No such file or directory Where main.cpp follows: Code: Select all#include <signal.h> //sigaction #include <curl/curl.h> static int caught_signal=-1; int main(int argc,char **argv) { curl_global_init(CURL_GLOBAL_DEFAULT); for(int i=0;i < 2;++i){ std::cerr << e.what() << std::endl; } curl_global_cleanup(); return 0; } I have reinstalled packages gettext and gettext-base. What else packages might be missing?
It's my fault. Given my script: Code: Select allREF_POT=/tmp/ref$$.pot find $1/cpp -maxdepth 1 -type f -name "*.cpp" -o -name "*.h" | xgettext --keyword=_:1,1t --keyword=N_:1,2,3t --keyword=translate:1,1t --keyword=translate:1,2,3t -C -o "$REF_POT" -f - find $2 -maxdepth 1 -type f -name main.cpp | xgettext -j --keyword=_:1,1t --keyword=N_:1,2,3t --keyword=translate:1,1t --keyword=translate:1,2,3t -C -o "$REF_POT" -f - If I give /tmp as the second argument, then the find $2 in the third command turns literally out to be find /tmp, which finds out nothing, and I get this weird error. I can give /tmp/ as the second argument $2 to avoid this issue. ==Edit: Looking for a way to close this topic...==
Hi I am trying to implement: Code: Select allfor i in *.txt; do nl w2 "$i¨ > "${i/_2.txt}"_3.txt ;done For a series of files. I end up with prompt > According to an example it should work! Thanks in advance,
makh wrote: 2023-05-13 09:49Code: Select allfor i in *.txt; do nl w2 "$i¨ > "${i/_2.txt}"_3.txt ;done The closing quote around the first $i is a diaeresis rather than a quotation mark. Beware of copy-pasting from random websites, it can be dangerous: https://www.bleepingcomputer.com/news/s ... et-hacked/
Hi, Code: Select allfor i in *; do echo ${i:0:2} | sed -e 's/^/-:/' $i > "$i"_new ;done First part returns: 61 62 63 ... And I need to get this number to add in start of ¨each line¨ of ¨each file¨: file 61... 61: line-1 61: line-2 61: line-3 file 62... 62: line-1 62: line-2 62: line-3 file 63... 63: line-1 63: line-2 63: line-3 I cannot figure out how to input the value - from pipe to sed: instead I get: -: line-1 -: line-2 -: line-3 Thanks in advance!
Hi, Code: Select all$> mkdir /tmp/filesDir/; cd /tmp/filesDir/ $> printf '%s ' "line-1" "line-2" "line-3" | tee ./61whatever ./62whatever ./63whatever line-1 line-2 line-3 $> for i in *; do sed 's/^/'"${i:0:2}"': /' "$i" > "$i"_new ;done $> cat ./*_new 61: line-1 61: line-2 61: line-3 62: line-1 62: line-2 62: line-3 63: line-1 63: line-2 63: line-3
I am trying to build krb5 from sources from its Github repo with intention to then install it into my home dir as a non-priveleged user, but the build fails at Code: Select allbison -y getdate.y make[2]: *** [<builtin>: getdate.c] Segmentation fault make[2]: Leaving directory '/home/eugrus/krb5/src/kadmin/cli' make[1]: *** [Makefile:834: all-recurse] Error 1 make[1]: Leaving directory '/home/eugrus/krb5/src/kadmin' make: *** [Makefile:1521: all-recurse] Error 1 Here is the full listing: https://gist.github.com/eugrus/23343a5a ... faac7033f7
Moved to "Programming" sub-forum.
Hello, I'm a C# novice, and I walked into such problem:Code: Select allusing System.Xml.Linq;during compilation throws an error: Code: Select allfoo.cs(1,18): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System.Xml'. Are you missing `System.Xml.Linq' assembly reference? So, I checked if I have proper "libmono" package on my Debian box. It turned out, that i don't have one, so I installed "libmono-system-xml-linq4.0-cil" package. Tried to compile with just "mcs foo.cs" and the error persists. Also tried with Code: Select allmcs -lib:/usr/lib/mono/4.5/System.Xml.Linq.dll foo.cswithout success. Do I understand the situation properly? What should I try next? Thank you for your help in advance.
Have you tried adding an assembly reference, as suggested by the error message? I don't use C# myself but a quick search suggests Code: Select all<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> It's always best to share the actual code when requesting assistance though, is that possible here? I'm sure there are other forum members more versed with C# than me and it might encourage them to participate.
Hi, I want to walk a largish directory tree and call the same bash script for each, with parent environment (directory) passed via stdargs, without creating a fork bomb. I was just wondering if there's an idiom or prior art for this? My first cut: Code: Select all$ cat ./brd.sh #!/bin/bash find "$1" -mindepth 1 -maxdepth 1 -type d | while read d ; do echo "$d" ./brd.sh "$d" done Code: Select allmkdir -p a/b/c/d/1/2/3 mkdir -p a/b/c/4/5/6 $ ./brd.sh . ./a ./a/b ./a/b/c ./a/b/c/d ./a/b/c/d/1 ./a/b/c/d/1/2 ./a/b/c/d/1/2/3 ./a/b/c/4 ./a/b/c/4/5 ./a/b/c/4/5/6 I'd be interested to hear about any caveats, before I release it to the wild. Cheers, bitrat
Moved to “Programming” sub-forum
... after I had removed last 3 commits and pushed to remote: Code: Select allgit reset HEAD^ --hard git reset HEAD^ --hard git reset HEAD^ --hard git push https://gitlab.com/myname/myproj -f Code: Select allgit status On branch master Your branch and 'origin/master' have diverged, and have 1 and 3 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working tree clean What will happen please if I run Code: Select allgit pull ?
output of Code: Select allgit pullwas empty but it has solved the problem.
I created a qt5 program and would like to set it up for installation in linux.
Hello, Debmann wrote: 2023-11-11 21:07 I created a qt5 program and would like to set it up for installation in linux. I'm not a Python expert, but it seems that PyInstaller is not in Debian repositories. Therefore, you might install PyInstaller in Debian according to its documentation: https://www.pyinstaller.org/en/stable/installation.html
Hello, How do I find the Debian binary package containing a C function ? For example, the source package named "samba" [1] generates the binary code for the C function named "remote_password_change" with the following prototype: Code: Select allNTSTATUS remote_password_change(const char *remote_machine, const char *domain, const char *user_name, const char *old_passwd, const char *new_passwd, char **err_str); Its definition is in the source file ./source3/libsmb/passchange.c included in the Debian source package for samba binary package: https://sources.debian.org/src/samba/2:4.19.2+dfsg-1/source3/libsmb/passchange.c/?hl=224#L33 How can I find the binary file containing the compiled code of function's definition and the binary Debian package that contains it ? Is there a command to search packages for the name of C functions compiled in its binaries ? Thanks. Aki. -- [1] https://tracker.debian.org/pkg/samba
Hello lindi, lindi wrote: 2023-11-04 18:50 How do I find the Debian binary package containing a C function ? For example, the source package named "samba" [1] generates the binary code for the C function named "remote_password_change" with the following prototype: Code: Select allNTSTATUS remote_password_change(const char *remote_machine, const char *domain, const char *user_name, const char *old_passwd, const char *new_passwd, char **err_str); Fetch -dbgsym packages for all of the binary packages generated from the source package. Then use "nm" to list symbols in those binaries? This still won't help if the function got inlined though. I followed your hint: 1) I configured /etc/apt/sources.list to add debian-debug repositories: Code: Select alldeb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware deb-src http://deb.debian.org/debian bookworm main non-free-firmware deb http://deb.debian.org/debian bookworm-updates main non-free-firmware deb-src http://deb.debian.org/debian bookworm-updates main non-free-firmware deb http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware deb-src http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware # Debug Symbols deb http://deb.debian.org/debian-debug/ bookworm-debug main contrib non-free non-free-firmware deb http://deb.debian.org/debian-debug/ bookworm-proposed-updates-debug main 2) Using the Debian site at https://packages.debian.org , I searched for the Debian source package of the samba binary package: https://packages.debian.org/search?keywords=samba&searchon=sourcenames&suite=stable&section=all I obtained the following output: Source Package samba bookworm (net): 2:4.17.12+dfsg-0+deb12u1 [security] Binary packages: [hide 26 binary packages] ctdb, ldb-tools, libldb-dev, libldb2, libnss-winbind, libpam-winbind, libsmbclient, libsmbclient-dev, libwbclient-dev, libwbclient0, python3-ldb, python3-ldb-dev, python3-samba, registry-tools, samba, samba-ad-dc, samba-ad-provision, samba-common, samba-common-bin, samba-dev, samba-dsdb-modules, samba-libs, samba-testsuite, samba-vfs-modules, smbclient, winbind 3) I copied, pasted and manually edited all the names of the binary packages built from the source package named "samba". Then, I assembled the following command (a simulated install) replacing the ',' character from previous output with "-dbgsym" (all symbols packages created by Debian project use the "-dbgsym" suffix): Code: Select all# apt -s install ctdb-dbgsym ldb-tools-dbgsym libldb-dev-dbgsym libldb2-dbgsym libnss-winbind-dbgsym libpam-winbind-dbgsym libsmbclient-dbgsym libsmbclient-dev-dbgsym libwbclient-dev-dbgsym libwbclient0-dbgsym python3-ldb-dbgsym python3-ldb-dev-dbgsym python3-samba-dbgsym registry-tools-dbgsym samba-dbgsym samba-ad-dc-dbgsym samba-ad-provision-dbgsym samba-common-dbgsym samba-common-bin-dbgsym samba-dev-dbgsym samba-dsdb-modules-dbgsym samba-libs-dbgsym samba-testsuite-dbgsym samba-vfs-modules-dbgsym smbclient-dbgsym winbind Reading package lists... Done Building dependency tree... Done Reading state information... Done E: Unable to locate package libldb-dev-dbgsym E: Unable to locate package libsmbclient-dev-dbgsym E: Unable to locate package libwbclient-dev-dbgsym E: Unable to locate package python3-ldb-dev-dbgsym E: Unable to locate package samba-ad-dc-dbgsym E: Unable to locate package samba-ad-provision-dbgsym E: Unable to locate package samba-common-dbgsym E: Unable to locate package samba-dev-dbgsym As you can see, some binary packages have no debug symbol packages. They are "-dev" packages, while the others packages I suppose don't contain libraries or executable code, therefore I suppose they could not supply debug symbols. 4) I modified the previous simulated command, removing references to not existing "-dbgsym" packages: Code: Select all# apt install ctdb-dbgsym ldb-tools-dbgsym \ libldb2-dbgsym libnss-winbind-dbgsym libpam-winbind-dbgsym \ libsmbclient-dbgsym libwbclient0-dbgsym python3-ldb-dbgsym \ python3-samba-dbgsym registry-tools-dbgsym samba-dbgsym \ samba-common-bin-dbgsym samba-dsdb-modules-dbgsym \ samba-libs-dbgsym samba-testsuite-dbgsym samba-vfs-modules-dbgsym \ smbclient-dbgsym winbind 5) I searched for the name of the C function named "remote_password_change" (using the nm package you advised to me) in debug symbols (note: "-dbgsym" packages store their "*.debug" files in the directory named /usr/lib/debug/ ) Code: Select all# find /usr/lib/debug -name "*.debug" -exec nm --print-file-name --line-numbers {} 2>&1 \; | grep "remote_password_change" It took about 6 minutes; the output was: Code: Select all# find /usr/lib/debug -name "*.debug" -exec nm --print-file-name --line-numbers {} 2>&1 \; | grep "remote_password_change" /usr/lib/debug/.build-id/db/feab433239b8e04dcce44968d70346ac03571a.debug:0000000000005830 T remote_password_change ./bin/default/../../source3/libsmb/passchange.c:37 Now I missing the last step: how can I tell which Debian binary package and binary executable (program) the following file refers to? Code: Select all/usr/lib/debug/.build-id/db/feab433239b8e04dcce44968d70346ac03571a.debug Is there a smarter way to do all this?
Hello. Didn't find, how to use spoilers here, so posted just a piece of "sensors" output. I have two of the "fan1" lines, and i need to show second one in conky. Can't figure, how to do it. Can someone explain, please? amdgpu-pci-2800 Adapter: PCI adapter fan1: 1137 RPM (min = 0 RPM, max = 3500 RPM) nct6797-isa-0a20 Adapter: ISA adapter fan1: 828 RPM (min = 0 RPM) fan2: 834 RPM (min = 0 RPM)
Moved to programming.
Hello! I can't find qt6 .qch documentation files. I have the ones for qt5. What is the Debian package for them? Thanks! Sylvain
Hello, sylvain_48 wrote: 2023-12-27 16:37 I can't find qt6 .qch documentation files. I have the ones for qt5. What is the Debian package for them? Are you searching for this ? See: https://packages.debian.org/trixie/all/qt6-base-doc/filelist
Won't go into the long winded reason, but I'm looking for a C++ http/REST library to create a management interface to a daemon I've been working on. not so concerned about SSL support as I am in "correct and proper" implementation of socket handling, URL parsing, and conformant document generation. The only real security I'm implementing is an authentication hash as one of the GET request params. Any recommendations?
crickets chirping, so I guess no recommendations. Writing the client side of such a service is a no brainer. I'm looking for a c++ class set that supports the server side: tcp connection managment/listenner, parsing of URLS, rudimentary document creation of html or json. couldn't care less about websockets protocol or SSL. Just interested in basic HTTP REST functionality.
So I have set up a Debian system. It's a bullseye install with newest updates. I'm using multiarch to make steam able to run. I have installed build-essential, which includes gcc-multilib. I have a simple piece of C code (the output remains the same regardless of code): Code: Select all#include <stdio.h> int main() { printf("%s","Hello world!"); return 0; } Compiled with: Code: Select allgcc Ex1.c The output is: Code: Select all/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status With a -v flag: Code: Select allUsing built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.1 20210110 (Debian 10.2.1-6) COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-linux-gnu/10/cc1 -quiet -v -imultiarch x86_64-linux-gnu Ex1.c -quiet -dumpbase Ex1.c -mtune=generic -march=x86-64 -auxbase Ex1 -version -fasynchronous-unwind-tables -o /tmp/ccCjCumF.s GNU C17 (Debian 10.2.1-6) version 10.2.1 20210110 (x86_64-linux-gnu) compiled by GNU C version 10.2.1 20210110, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/include-fixed" ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/x86_64-linux-gnu/10/include /usr/local/include /usr/include/x86_64-linux-gnu /usr/include End of search list. GNU C17 (Debian 10.2.1-6) version 10.2.1 20210110 (x86_64-linux-gnu) compiled by GNU C version 10.2.1 20210110, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 1f803793fa2e3418c492b25e7d3eac2f COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64' as -v --64 -o /tmp/ccAXLnIF.o /tmp/ccCjCumF.s GNU assembler version 2.35.2 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.35.2 COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/ LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64' /usr/lib/gcc/x86_64-linux-gnu/10/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper -plugin-opt=-fresolution=/tmp/ccUXWOCD.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. /tmp/ccAXLnIF.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status
LE_746F6D617A7A69 wrote: 2022-04-19 21:22You can try the debsums command to verify the OS installation. Or just dpkg --verify. Are you aware of any difference between the two commands? debsums package description: tool for verification of installed package files against MD5 checksums debsums can verify the integrity of installed package files against MD5 checksums installed by the package, or generated from a .deb archive. man 1 dpkg excerpt: -V, --verify [package-name...] Verifies the integrity of package-name or all packages if omitted [...] Currently the only functional check performed is an md5sum verification of the file contents against the stored value in the files database.
How can I make an app think it's running in another directory (without merely changing HOME environment variable, which doesn't always work, and it also doesn't work with non-home directories)? Any input would be GREATLY appreciated!
Yep - we need a use case to understand what you're trying to do
I want to use anaconda-mode in Emacs and apparently this is included in emacs-prelude. Installations according to https://github.com/bbatsov/prelude "Fast forward" seems to work but when starting Emacs I get an error which I can't figure out. This is what Emacs gives me: Code: Select allError message when starting emacs: Warning (initialization): An error occurred while loading ‘/home/eva/.emacs.d/init.el’: error: Package ‘ace-window-’ is unavailable To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the ‘--debug-init’ option to view a complete error backtrace. Restarting with the suggested argument gives: Code: Select allDebugger entered--Lisp error: (file-error "https://melpa.org/packages/archive-contents" "Bad Request") signal(file-error ("https://melpa.org/packages/archive-contents" "Bad Request")) package--download-one-archive(("melpa" . "https://melpa.org/packages/") "archive-contents" nil) package--download-and-read-archives(nil) package-refresh-contents() prelude-install-packages() require(prelude-packages) eval-buffer(#<buffer *load*> nil "/home/eva/.emacs.d/init.el" nil t) ; Reading at buffer position 4598 load-with-code-conversion("/home/eva/.emacs.d/init.el" "/home/eva/.emacs.d/init.el" t t) load("/home/eva/.emacs.d/init" t t) #f(compiled-function () #<bytecode 0x1dda91>)() command-line() normal-top-level() I guess the URL https://melpa.org/packages/archive-contents is wrong but I can't figure out where in the Prelude installation this is. Ideas anyone? Cheers, gostal
It appears the problem is a version issue related to TLS, see Code: Select allhttps://melpa.org/#/getting-started. I found, however, another guide: https://idevji.com/blog/2019/01/09/conf ... -on-emacs/ Installed anaconda-mode according to that page and got this: Code: Select allChecking /home/eva/.emacs.d/elpa/anaconda-mode-20211122.817... Done (Total of 1 file compiled, 2 skipped) You can run the command ‘package-install’ with M-x p-ins RET Done (Total of 1 file compiled, 2 skipped) Tried to enable anaconda-mode by adding: Code: Select all(add-hook ‘python-mode-hook ‘anaconda-mode) and got this: Code: Select allWarning (initialization): An error occurred while loading ‘/home/eva/.emacs.d/init.el’: Symbol's value as variable is void: ‘python-mode-hook ... causing init debugger output: Code: Select allDebugger entered--Lisp error: (void-variable ‘python-mode-hook) (add-hook ‘python-mode-hook ‘anaconda-mode) eval-buffer(#<buffer *load*> nil "/home/eva/.emacs.d/init.el" nil t) ; Reading at buffer position 1322 load-with-code-conversion("/home/eva/.emacs.d/init.el" "/home/eva/.emacs.d/init.el" t t) load("/home/eva/.emacs.d/init" t t) #f(compiled-function () #<bytecode 0x1dda91>)() command-line() normal-top-level() Can't figure this one out. Commenting out python-mode-hook in init.el removes the error but then there is no anaconda-mode. Please help! Cheers, gostal
I am trying to modify a cmake-based source to use system SoundTouch instead of the bundled one.There is a 3rdparty directory with a CMakeLists.txt and a 3rdparty/soundtouch directory, also with CMakeLists.txt. I have made this addition to 3rdparty/soundtouch/CMakeLists.txt: Code: Select allif( USE_SYSTEM_SOUNDTOUCH) find_package(soundtouch) if(NOT soundtouch_FOUND) message(FATAL_ERROR "USE_SYSTEM_SOUNDTOUCH is set, but shared SoundTouch was not found!") else() add_library(soundtouch SHARED IMPORTED GLOBAL) set_target_properties(soundtouch PROPERTIES IMPORTED_LOCATION ${SoundTouch_LIBRARY} INCLUDE_DIRECTORIES ${SoundTouch_INCLUDE} ) message(STATUS "SoundTouch include is " ${SoundTouch_INCLUDE}) endif() I have added Findsoundtouch.cmake that looks like this: Code: Select allfind_path(SoundTouch_INCLUDE PATH_SUFFIXES soundtouch NAMES SoundTouch.h) find_library(SoundTouch_LIBRARY NAMES SoundTouch) find_package_handle_standard_args(soundtouch REQUIRED_VARS SoundTouch_LIBRARY SoundTouch_INCLUDE) When I run cmake with USE_SYSTEM_SOUNDTOUCH, it says: Code: Select all-- Found soundtouch: /usr/lib/x86_64-linux-gnu/libSoundTouch.so -- SoundTouch include is /usr/include/soundtouch however, when I try to make: Code: Select allIn file included from /home/sdebian/git-clones/rpcs3/rpcs3/Emu/Audio/audio_resampler.cpp:2: /home/sdebian/git-clones/rpcs3/rpcs3/Emu/Audio/audio_resampler.h:10:10: fatal error: SoundTouch.h: No such file or directory 10 | #include <SoundTouch.h> | ^~~~~~~~~~~~~~ compilation terminated. running "find /usr/include -iname "*soundtouch*" gives: Code: Select all/usr/include/soundtouch /usr/include/soundtouch/soundtouch_config.h /usr/include/soundtouch/SoundTouch.h So I have no idea what I'm doing wrong. FWIW the directory structure is: Code: Select all| |->3rdparty->CMakeLists.txt | | | soundtouch->CMakeLists.txt | |->buildfiles->cmake->Findsoundtouch.cmake | | | | CMakeLists.txt
I think maybe Code: Select all #include <SoundTouch.h> in audio_resampler.h needs to change to be Code: Select all#include <soundtouch/SoundTouch.h>
Hello everyone, I'm trying to compile an application on Debian 11, but I have a problem at link time: gcc can't find the shared libraries (for example libsqlite3.so.0 or libcurses.so.0). To illustrate my problem, this example of a program with its Makefile Code: Select all/* foo.c */ #include <sqlite3.h> #include <stdio.h> int main(void) { printf("%s ", sqlite3_libversion()); return 0; } and the Makefile Code: Select allCFLAGS = -I/usr/include -Wall LDFLAGS = -lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib all: $(CC) $(CFLAGS) -Os -c foo.c -o foo.o $(CC) $(LDFLAGS) foo.o -o foo I get the following error message: Code: Select allvalter@debian:~# make gcc -I/usr/include -Wall -lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib foo.c -o foo /usr/bin/ld : /tmp/cc0yzZNg.o : in the "main" function : foo.c:(.text+0x5) : undefined reference to "sqlite3_libversion collect2: error: ld returned 1 exit status make: *** [Makefile:5 : all] Error 1 Of course, the sqlite3_libversion function is present in the shared library: Code: Select allvalter@debian:~# nm -gD /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 | grep sqlite3_libversion 00000000000132d0 T sqlite3_libversion 00000000000132e0 T sqlite3_libversion_number It compiles without problem on other OS (Rocky Linux 8 (gcc 8.5.0), macOS and FreeBSD(LLVM)). Are there any special features on Debian for linking? Any help will be appreciated. Sincerely
Hello, You can postpone the LDFLAGS after the object file you have to link to the library, for example: Code: Select allCFLAGS = -I/usr/include -Wall LDFLAGS = -lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib all: $(CC) $(CFLAGS) -Os -c foo.c -o foo.o $(CC) foo.o -o foo $(LDFLAGS)
I am trying to package Yuzu and I have some questions Is it possible to automate filling in the Build-depends field of control? In the same way as you can use ${shlibs:Depends} to fill the Depends field? After dh_auto_install runs, the install prefix has directories bin/ lib/ include/ share/. I want to exclude the lib/ and include/ directory. I'm sure I've seen this done in a rules file with the -X and --exclude= option, but for me dh_auto_install just ignores it. My toolchain necessitates using Clang, but dh_dwm crashes if you don't use DWARF-4. According to this bug report, you can force this with the "-gdwarf-4" flag. How do I do this in a cmake-based rules file? -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -gdwarf-4" doesn't work. Nor does passing this option to -DCMAKE_EXE_LINKER_FLAGS. FWIW, here is what my rules file looks like: Code: Select all#!/usr/bin/make -f CMAKE_OPTIONS := \ -DCMAKE_INSTALL_PREFIX=/usr \ -DYUZU_USE_QT_WEB_ENGINE=ON \ -DYUZU_USE_EXTERNAL_SDL2=OFF \ -DCMAKE_C_COMPILER=clang-14 \ -DCMAKE_CXX_COMPILER=clang++-14 \ -DYUZU_TESTS=OFF \ -DYUZU_CHECK_SUBMODULES=OFF \ -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS} -gdwarf-4" %: dh $@ override_dh_auto_configure: mkdir obj-$(DEB_HOST_MULTIARCH) && cd obj-$(DEB_HOST_MULTIARCH) && cmake .. -GNinja $(CMAKE_OPTIONS) override_dh_make: cd obj-$(DEB_HOST_MULTIARCH) && ninja override_dh_auto_install: dh_auto_install -Xlib/cmake/xbyak/* -Xinclude/tsl/* -Xusr/include/xbyak/* --
MultiplexLayout wrote:My toolchain necessitates using Clang, but dh_dwm crashes if you don't use DWARF-4. According to this bug report, you can force this with the "-gdwarf-4" flag. How do I do this in a cmake-based rules file? -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -gdwarf-4" doesn't work. Nor does passing this option to -DCMAKE_EXE_LINKER_FLAGS. What if you try something like this: Code: Select allDEB_CMAKE_OPTIONS ?= -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -gdwarf-4" in your rules file?
I have this error on D11: Code: Select allmake "CFLAGS=$(pkg-config --cflags --libs xcb xcb-randr)" bspwmxzoomrule cc -lxcb -lxcb-randr bspwmxzoomrule.c -o bspwmxzoomrule /usr/bin/ld: /tmp/ccFprU6F.o: in function `main': bspwmxzoomrule.c:(.text+0xd7): undefined reference to `xcb_connect' /usr/bin/ld: bspwmxzoomrule.c:(.text+0xe7): undefined reference to `xcb_connection_has_error' /usr/bin/ld: bspwmxzoomrule.c:(.text+0x147): undefined reference to `xcb_get_property' /usr/bin/ld: bspwmxzoomrule.c:(.text+0x164): undefined reference to `xcb_get_property_reply' /usr/bin/ld: bspwmxzoomrule.c:(.text+0x1ac): undefined reference to `xcb_get_property_value_length' /usr/bin/ld: bspwmxzoomrule.c:(.text+0x1c8): undefined reference to `xcb_get_property_value' collect2: error: ld returned 1 exit status make: *** [<builtin>: bspwmxzoomrule] Error 1 When compiling this: Code: Select all#include <ctype.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <xcb/xproto.h> /* make "CFLAGS=$(pkg-config --cflags --libs xcb)" bspwmxzoomrule cc -lxcb bspwmxzoomrule.c -o bspwmxzoomrule */ int main(const int argc, const char *const argv[]) { if (argc < 2) { if (fputs("No arguments given. ", stderr) == EOF) perror("fputs"); return EXIT_FAILURE; } char *end; const union { unsigned long as_ulong; xcb_window_t as_xcb_window_t; } wid = { .as_ulong = strtoul(argv[1], &end, 0), }; if (wid.as_ulong == ULONG_MAX) { perror("strtoul"); return EXIT_FAILURE; } if (*end != '\0' || wid.as_xcb_window_t == XCB_NONE) { if (fputs("Invalid argument. ", stderr) == EOF) perror("fputs"); return EXIT_FAILURE; } xcb_connection_t *const xcb = xcb_connect(NULL, NULL); if (xcb_connection_has_error(xcb)) { if (fputs("xcb_connect() failed. ", stderr) == EOF) perror("fputs"); return EXIT_FAILURE; } static const char xzoom_str[] = "xzoom"; const xcb_get_property_cookie_t cookie = xcb_get_property(xcb, 0, wid.as_xcb_window_t, XCB_ATOM_WM_ICON_NAME, XCB_ATOM_STRING, 0, sizeof xzoom_str ? 1 + (sizeof xzoom_str - 1) / 4 : 0); xcb_get_property_reply_t *const reply = xcb_get_property_reply(xcb, cookie, NULL); if (reply == NULL) { if (EOF == fputs("xcb_get_property(WM_ICON_NAME) failed. ", stderr)) { perror("fputs"); } return EXIT_FAILURE; } const int length = xcb_get_property_value_length(reply); if (length != sizeof xzoom_str - 1) return EXIT_FAILURE; const char *const value = xcb_get_property_value(reply); if (strncmp(value, xzoom_str, sizeof xzoom_str - 1) != 0) return EXIT_FAILURE; free(reply); if (puts("state=floating sticky=on") == EOF) { perror("puts"); return EXIT_FAILURE; } return EXIT_SUCCESS; } I was told to report about "XCB library and why the behavior is different apart from most of the other linux distros". Is this a Debian 11 problem?
Hi, Your program and build command looks OK. Apparently, for some strange reason the linker can't find the libxcb.so library. The library should be located at: /usr/lib/x86_64-linux-gnu/libxcb.so (assuming that You have 64bit OS). Also You should check the output of ldconfig -v: Code: Select all>sudo ldconfig -v | grep libxcb.so (...) libxcb.so.1 -> libxcb.so.1.1.0 // <-- THIS (...) Scorpion wrote: 2022-12-05 17:14 I was told to report about "XCB library and why the behavior is different apart from most of the other linux distros". Nope, there's nothing unusual in the behavior of libxcb under Debian
Bugzilla doesn't seem to list any serious issues with CUDA Toolkit on Debian 11. But on the other hand, NVidia's only download option is for Debian 10. I'd love to hear from real people using/writing CUDA C on Debian 11. Are there any issues to watch out for? Is it better to wait before upgrading to Debian 11? (CUDA is a must for me)
I don't use CUDA but there are a number of cuda packages available in Bullseye. I have no idea whether they are the ones you need. https://packages.debian.org/search?suit ... words=CUDA
I am trying to modify an epub file that uses image files instead of accented letters. I am replacing the images with unicode characters. In order to do this I need to perform a find and replace on a regex matching the image tag, from the opening angle bracket to the closing one. However, consider the following: Code: Select all<img alt="image" src="c0011-01.jpg"/>s</strong> because the <strong>mi</strong> is short, but <strong>a-m<img alt="image" src="c0007-01.jpg"/>-tus</strong> because the <strong>m<img alt="image" src="c0025-01.jpg"/> I want to target the image tag containing c0007-01.jpg but it is flanked by two other image tags. Any regex I have tried targets from the first image tag (c0011-01.jpg) to the third c0025.jpg). I need a regex that: starts at the "<" and ends at the ">" (so I can execute a find and replace cleanly) must contain c0007-01.jpg does not contain any additional "<" within If I have a regex that fulfills the above criteria, I'm fairly sure that it will only target the tag I want. Any help would be greatly appreciated.
You need a 'non greedy' match. Probably include a 'NOT <' term. I can't spit one out ATM,, but that might help your search.
This is driving me crazy. I keep getting compile time warning message Suspicious pointer conversion in function fillbox. The line of code this is happening in is: Code: Select allif ( !bsearch(bigwords[5] + 1, shorties, sizeof(shorties) / sizeof(shorties[0]), sizeof(shorties[0]), strcmp)) The header and selected source lines of function fillbox() are: Code: Select allchar* fillbox(struct ELEMENT*, char*); char* fillbox(struct ELEMENT* taskwalk, char* floater) { const static char shorties[11][5] = {"a", "an", "at", "by", "go", "meet", "of", "see", "the", "to", "with"}; char bigwords[6][36]; if ( !bsearch(bigwords[5] + 1, shorties, sizeof(shorties) / sizeof(shorties[0]), sizeof(shorties[0]), strcmp)) {bigwords[5][0] = wordsize; {strcpy(bigwords[k], bigwords[k + 1]);};}; return(g.workarea + 1);}; For reference, the headers for bsearch() [from stdlib.h] and strcmp() [from string.h] are: Code: Select allvoid *_Cdecl bsearch(const void *key, const void *base, size_t nelem, size_t width, int _Cdecl (*fcmp)(const void *, const void *)); int _Cdecl strcmp (const char *s1, const char *s2); I tried rearranging my code, typecasting the parameters in my code to match the header of bsearch(), and other things but nothing seems to work. Any ideas? Caitlin
Can you post a working example of the code? We don't know what a struct "ELEMENT" is, nor what "wordsize". "k" and "g" (incl. "g.workarea") are also not defined. And you have a very weird use of ; and { }, as well as formatting in general (but that should not be the problem, it just makes it very hard to debug).
The usual code on console: xset dpms force off Also have xscreensaver-demo installed by default. But this can only be initiated from the GUI. Don't want these. My need is to have a screensaver and LED of screen "powered off" run iteratively when required without further ado. Don't want xlock through xautolock, if the unlock a password every time. Unlike this one: How to run custom script as screensaver in Openbox? Within a script file, sssvr.sh, something like the following: Code: Select all#!/bin/bash echo "Usage: ./ssvr.sh ssvr.sh" done=0 i=0 while true do expr $(( i = i + 1 )) read -p "To stop press n and Enter : " -t 2 INPOOT xset dpms force off kill -19 `pidof $1` sleep 12 xset dpms force off kill -18 `pidof $1` sleep 2 if [ "$INPOOT" = "n" ]; then echo "Ending..." echo exit 0 fi done The script works. But is it possible to have the above-mentioned script file run through xautolock. Now that is the pertinent question. Any suggestion for improvement to the simple script is also welcome. Any support possible?
bkpsusmitaa wrote:The usual code on console: xset dpms force off Also have xscreensaver-demo installed by default. But this can only be initiated from the GUI. Don't want these. xscreensaver-demo can most certainly be initiated from a script. Maybe it won't do the other things you want to do. Just open a terminal and type "xscreensaver-demo &" and it will open. And, I have written a simple script that will run xscreensaver-demo.
I opened the nemo-desktop file, /usr/bin/nemo-desktop with ghex (gnome hex editor). Is this the right app? That file is from the nemo package. With search (CTRL+F) I found the warning that you get when you use root. Can I see what is triggering that warning? So maybe I can remove it as for tor-browser. Maybe there is something that checks what user is launching it.
There is a root check, you need to build it from source. https://github.com/Scorpion2185/nemo-desktop-bullseye https://github.com/linuxmint/cinnamon/issues/9994
SOLUTION My Bash idiom was immature. Scripting in Bash apparently requires some different habits than entering commands interactively on the command line does. For example, it requires that one terminate command-line options using '--'. It requires that one prefer printf or <<< rather than echo in some circumstances. It requires a clear understanding of the eval builtin. It requires lots of things. In general, Bash has ways of escaping various possible misinterpretations of text, for example via the aforementioned '--' and eval, not to mention quoting. Most of these ways are unfamiliar to Bash command-line users (or at any rate, they were unfamiliar to me), so they must be learned—and, once learned, must frequently be employed. Coming from C++, I had not been used to escaping everything, like this: Code: Select allrun_by_batch wget_insist "'"'-nc -x -nH --cut-dirs=4 -P '"'"'"'"'"'"'"$TARGET/pool"'"'"'"'"'"'"' --'"'" It actually makes some sense once one thinks about it in the right way, but it's a little hard to get used to. Bash lacks programming support for long scripts, but support is for scripts longer than about 3000 lines. A decent programmer can work without support up to that length, so lack of support was not my problem. My problem was immature Bash idiom. Bash scales poorly when idiom is immature. I suppose that there is no good remedy for immature scripting idiom other than writing a few thousand lines and failing at it, while occasionally seeking advice. The various advice others have given below has helped. ORIGINAL QUESTION In your opinion, how practical is it to write complex Bash shell scripts that handle offbeat filenames and pathnames like, say, 'My Files/-Preferences:(3)'? I realize that it is possible to write such scripts, but every time one mixes various quoting and expansion mechanisms like (say) echo ${X}{1,2} | sed "s/${A}/${B%$C}/" or uses eval or the like, Bash—or various command-line tools invoked from Bash—seems to remind one how much it dislikes offbeat filenames. The script on which I am now working is a moderate 1500 lines or so in length, yet I have spent so many hours tracking down obscure bugs due to quoting and expansion issues that I am thinking of having the script simply reject all unconventional pathnames. Some users won't like that. Meanwhile, I feel that I am fighting Bash. I would instead like to work with Bash, and I would prefer not to give up on Bash just because some users have ported Microsoft-style file-naming habits to Debian. Is there an easy way to do this? What am I missing, please?
It of course depends on what you're trying to do. What are you trying to do anyway? :) Normally you don't need to manipulate file names, you just pass them to a program, etc. and as long as they're quoted ("$NAME" instead of $NAME), there's usually no problem. But yes, the general idea is that everything is text, so a command line is parsed as text, commonly separating tokens by spaces, which may be a problem. I hear Powershell is more "object oriented", but everytime I see a Powershell script I think something is deeply wrong with the concept, and seems only OK for programming but not for an interactive shell. So, again, what are you trying to do? maybe there's an easier/simpler way.
I need to create a Makefile. I have a test project called Funzioni and it is structured as follows: Funzioni: Makefile | ---- Build: calcolo, esempio.o, main.o | ---- src: esempio.c, main.c | ---- include: esempio.h I don't know how to tell the Makefile to put the object files example.o and main.o and the compute executable in the build directory and to read the sources placed in src. The Makefile I wrote is: Code: Select allINC_PATH = -I./include -I/usr/local/include LIB_PATH = -L./lib LIBS = CC = gcc CFLAGS = -Wall -g -O2 -D_DEBUG SOURCES = $(wildcard src/*.c) OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) vpath %.c src vpath %.o build EXECUTABLE = calcolo all: $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIB_PATH) $(LIBS) %.o: %.c $(CC) $(CFLAGS) -c $(INC_PATH) $< $(LIB_PATH) $(LIBS) Can you tell me what changes I have to make to achieve the purpose illustrated at the beginning ?
giorgik wrote:I need to create a Makefile. I have a test project called Funzioni and it is structured as follows: Funzioni: Makefile | ---- Build: calcolo, esempio.o, main.o | ---- src: esempio.c, main.c | ---- include: esempio.h I don't know how to tell the Makefile to put the object files example.o and main.o and the compute executable in the build directory and to read the sources placed in src. The Makefile I wrote is: Code: Select allINC_PATH = -I./include -I/usr/local/include LIB_PATH = -L./lib LIBS = CC = gcc CFLAGS = -Wall -g -O2 -D_DEBUG SOURCES = $(wildcard src/*.c) OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) vpath %.c src vpath %.o build EXECUTABLE = calcolo all: $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIB_PATH) $(LIBS) %.o: %.c $(CC) $(CFLAGS) -c $(INC_PATH) $< $(LIB_PATH) $(LIBS) Can you tell me what changes I have to make to achieve the purpose illustrated at the beginning ? I think your %.o: %.c rule needs to include an explicit "-o $@", as otherwise the object files will be left in the current directory, rather than on the defined VPATH for .o files. So you'd need: Code: Select all%.o: %.c $(CC) $(CFLAGS) -c $(INC_PATH) $< -o $@ (I also removed the $LIBS and $LIB_PATH since you don't need those when building object files). There may be other things you need. I think you should start with the basics (like not mixing executables with objects, etc.) and maybe reading https://www.gnu.org/prep/standards/html ... asics.html will certainly help. My make-fu is very rusty, so there may be other things that need to be fixed.
Hi debian team, I am on a Debian 10.4 system. I am trying to compile the shadow-4.5 package due to changes in the source code. Here is my procedure: Code: Select all$ apt-get source shadow/stable $ apt-get build-dep shadow $ export QUILT_PATCHES=debian/patches $ export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index" $ quilt push -a $ quilt new xxx_test_patch $ quilt add <file_changed> $ < here my source code modifications ... > $ quilt refresh $ quilt pop -a And, finally change version number and build my package : Code: Select all$ dch --local test $ debuild -b -us -uc My package is built without problem but the binaries contained in the generated .deb files do not contain my modifications. However, when I manually compile the binaries (with configure and make), the binaries generated in the src directory of my source tree do contain my changes. I have the impression that the package is not recompiled with "debuild". I would like to generate the exact debian package (.deb) with just my modifications in addition using the tool recommended by debian "debuild". I don't know if I forgot or did something wrong. Thanks in advance for your answers. P.
Did you change into the package directory? I can't see it in your command list but I suppose you must have if dch & debuild worked. I also can't find a "shadow" package in Debian, can you elaborate? Anyway, here's a simpler method: Code: Select allapt-get source shadow/stable apt-get build-dep shadow cd shadow* < edit source code > dpkg-source --commit < edit patch name & description > dch --local test debuild -us -uc I just use dpkg-source these days so I can't really remember how to use quilt properly but have you seen https://www.debian.org/doc/manuals/debm ... uilt-setup? And finally: p_linux wrote:I am on a Debian 10.4 You really should update your system: Code: Select all$ cat /etc/debian_version 10.7 $
So I installed "python3-pip" in Buster and would like to know: 1 - Will installed pip packages will be automatically updated or not. 2 - Is there a daemon running in the background for python or pip when it is not in use? Thanks!
No and no, respectively. But you really shouldn't use pip at all: https://xkcd.com/1987/ Python modules are trivially easy to package in Debian.
This is driving me nuts, have been banging my head two days, but can't figure it out. In python3 shell it works as expected: Code: Select all$ python3 Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> aika = '21.11.2019 21.44.57' >>> lampo = '+49.0°C' >>> f'{aika} {lampo}' '21.11.2019 21.44.57 +49.0°C' >>> The script I'm working on: Code: Select all#!/usr/bin/env python3 import subprocess, time while True: subprocess.call("/home/arto/bin/lampo.sh") with open("/tmp/aika") as fa: aika = fa.readline() with open("/tmp/lampo") as fl: lampo = fl.readline() print(f'{aika} {lampo}') time.sleep(30) Output: Code: Select all21.11.2019 21.54.21 +50.0°C 21.11.2019 21.54.28 +50.0°C 21.11.2019 21.54.37 +49.0°C 21.11.2019 21.54.51 +50.0°C 21.11.2019 21.54.58 +50.0°C 21.11.2019 21.55.07 +50.0°C 21.11.2019 21.55.21 +50.0°C And the bash script, that is launched from python3 script: Code: Select all#!/bin/bash if [ -f /tmp/aika ] then rm /tmp/aika fi if [ -f /tmp/lampo ] then rm /tmp/lampo fi if [ -f /tmp/dd ] then rm /tmp/dd fi date >> /tmp/dd cat /tmp/dd | gawk '{print $2, $3}' >> /tmp/aika sensors | grep 'Core 3:' | gawk '{printf $3" "}' >> /tmp/lampo What is the problem, why can't I get two string variables printed to same line?
arzgi wrote:What is the problem, why can't I get two string variables printed to same line? Calling readlines() will read the whole file line by line (including the newlines!). You need to strip the newlines before printing the results to get them in one line: Code: Select allaika = aika.replace(' ', '')
Hi, How do you set a password environment param?, do you have to unset it just after using so not giving enought time for anyone to track it? I would do it like this.,,tell me please, If Im doing wrong or can be done in some better way.. , thanks. (secrets.sh script picks a password from a secrets file) Code: Select allexport RCLONE_CONFIG_PASS=$(sudo /home/user/scripts/secrets.sh XXYY6) rclone sync source/ target/ & sleep 1 && unset RCLONE_CONFIG_PASS while ! -z $(pgrep -f /bin/rclone); do; sleep 1 && echo "wait for rclone task" ; done; Whith that code we only give one second to exposing the password... How do you usually do this?
ok, perhaps this!!, doesnt seem to be an easy way but this: https://unix.stackexchange.com/question ... ll-scripts There's a way to store passwords in a bash script but you have to encrypt and obfuscate the script so that no one can actually read it or run any type of debugger on it to see exactly what it is doing. I wonder what linux apps do we have to make it easy and create to binary:roll: >> shc
I'm trying to use qsort() to sort a table with 5 entries in it (room for 100) in a program. I've verified that the data in the table is valid when I call qsort(), but afterwards, there is nothing but trash there. I'm programming in C using gcc. I've used qsort() successfully many times before under Turbo C, but this is the first time for gcc. One difference is that Turbo C uses 2-byte short ints, but gcc uses 4-byte short ints. I thought gcc might be inserting slack bytes in the ELEMEN structure, but I added the ((packed)) attribute and this did not fix the problem. Perhaps my call to the qsort() function is wrong. This particular problem is not mentioned on the internet. I checked the syntax of the call to qsort() there and it seems to be correct. There's nothing else to check there. I'm including (what I believe to be) the relevant portions of my program. Let me know if you need anything else. Code: Select all#include <stdlib.h> /* 5 */ #define NOSLACK __attribute__((packed)) /* don't insert slack bytes (comp without sync) */ /* 10 */ #define TABWIDTH 200 /* width of table of tasks, prereqs, and postreqs (task table) */ /* 41 */ #define TABSIZE 100 /* number of entries in task table */ #define FIXED 3 * sizeof(short int) + 2 * sizeof(char) /* size of fixed-length portion of task table */ struct ELEMEN /* 59 */ {short int tasknum; /* task number of THIS task (excluding any step number) */ char stepnum; /* step number (first = 'a', etc.) */ char flags; /* flags pertaining to this task */ short int numpre; /* number of prereqs this task has */ short int numpost; /* number of postreqs this task has */ short int prereqs[0]; /* table of prerequisites (omitted if numpre = 0) */ short int postreqs[0]; /* table of postrequisites (omitted if numpost = 0) */ char fragment[TABWIDTH /* fragment of the description; the max- */ - FIXED];}; /* imum that will fit (with zero byte) */ /* the lengths of all the above fields should total to TABWIDTH */ /* 70 */ struct GLOBALS /* some global variables follow: */ {NOSLACK struct ELEMEN cactus[TABSIZE]; . . . char workarea[600];} g; /* input buffer */ int e35(const void*, const void*); qsort(&g.cactus, g.numelem, TABWIDTH, e35); /* sort cactus using e35() */ int e35(const void* elem1, const void* elem2) {return (((const struct ELEMEN*)elem1)-> tasknum > ((const struct ELEMEN*)elem2)-> tasknum) /* 395 */ - (((const struct ELEMEN*)elem1)-> tasknum < ((const struct ELEMEN*)elem2)-> tasknum);};
A trivial bug: You're passing incorrect size of element to qsort(): it should be sizeof(struct ELEMEN), not TABWIDTH
I am learning data structures in C. I have written some simple functions for cursor based lists. I have header file list.h and c file list.c with functions in it. The file list.c is compiled without problems. I have a main program purge.c in which functions from list.c are used. The listing is: Code: Select all#include <stdio.h> #include "list.h" #include <stdlib.h> void purge_crs_lst( int_crs_lst *, space_crs * ); int main() { space_crs s; initialize_space_crs_lst( &s ); int_crs_lst l = readlist_crs_lst( &s ); purge_crs_lst( &l, &s ); printlist_crs_lst( l, &s ); l = makenull_crs_lst( &l, &s ); return 0; } void purge_crs_lst( int_crs_lst *l_p, space_crs *s_p ) { position_crs_lst p, q; p = first_crs_lst( *l_p, s_p ); while( p != end_crs_lst( *l_p, s_p ) ) { q = next_crs_lst( p, *l_p, s_p ); while( q != end_crs_lst( *l_p, s_p ) ) if( retrieve_crs_lst( p, *l_p, s_p ) == retrieve_crs_lst( q, *l_p, s_p ) ) delete_crs_lst( q, l_p, s_p ); else q = next_crs_lst( q, *l_p, s_p ); p = next_crs_lst( p, *l_p, s_p ); } } When I compile this program with: Code: Select allgcc -Wall -o purge list.o purge.c I get this error message: Code: Select all/usr/bin/ld: /tmp/ccaSqwBa.o: in function `main': purge_crs.c:(.text+0x25): undefined reference to `readlist_crs_lst' /usr/bin/ld: purge_crs.c:(.text+0x44): undefined reference to `purge_crs_lst' /usr/bin/ld: /tmp/ccaSqwBa.o: in function `purge_crs_lst': purge_crs.c:(.text+0xa6): undefined reference to `first_crs_lst' collect2: error: ld returned 1 exit status What is the problem?
Errors are in purge_crs.c, but you have posted purge.c. So, we cannot see source of errors...
I have this C program, and I keep getting compile warnings. (The entire program is thousands of lines long, so I can't post the whole thing -- but I'll include all the relevant parts.) The problem occurs when one structure, TPARAMS, points to another structure, XUNDO2, and that structure points to a short table, xnewstep[], which points to yet another structure, ELEMENT. But the pointer to XUNDO2 can also point to XUNDO1 or XUNDO3, so it is defined as a void* pointer. Since THAT pointer is NOT defined as struct XUNDO2*, the compiler doesn't know where to find the xnewstep table. I want to use a type cast to say, in this case, the pointer indeed points to an XUNDO2 structure. Code: Select allstruct XUNDO1 {struct ELEMENT* xnewstep[9]; struct ELEMENT* xoldstep[9]; char xvalue[9];}; struct XUNDO2 {struct ELEMENT* xnewstep[9];}; struct XUNDO3 {struct ELEMENT* xpostreq[100];}; struct TPARAMS {short int action; char kind; char newtsnum[6]; char newstat; struct ELEMENT* newtask; struct ELEMENT* oldtask; struct ELEMENT* addpoint; struct ELEMENT* topstep; struct UNDO* unthing; void* /* points to the extended undo area; this could */ xthing;}; /* be the structure XUNDO1, XUNDO2, or XUNDO3 */ struct ELEMENT {struct ELEMENT* chain1; struct ELEMENT* chain2; struct ELEMENT* chain3; short int duetime; short unsigned int duedate; char status; char priority[2]; char tasktype; char tasknum[4]; char stepnum; char descript[2];}; void edittask(struct ELEMENT* origtask) {struct TPARAMS t; . . . {t.oldtask = ((struct XUNDO2*)t.xthing)-> xnewstep[i]; /* WORKS FINE */ . . . baseopts(&t); . . . void baseopts(struct TPARAMS* t) . . . {addopts(descbuf, t); . . . void addopts(char descbuf[], struct TPARAMS* t) . . . {if ((struct XUNDO2*)t-> xthing-> xnewstep[s] != 0) break;}; . . . The last line of code above, with the break keyword, is the one that has the problem. When I compile this, I get Warning . . . 'xnewstep' not part of structure in function addopts . I want to be able to use the type cast "(struct XUNDO2*)" to let the compiler know I'm pointing to an XUNDO2 structure -- but I can't seem to figure out exactly where to put it. I can work around this problem by assigning t-> xthing to a temporary variable then type casting that, or by redefining xthing as a struct XUNDO2* variable. But either of these solutions would reduce the readability of the program. I've googled type casts and pointers, but nothing I found covers this exact situation. I'm using Turbo C and running the binary under DOSBox under Debian Stretch with the MATE desktop. (Later on, I will rewrite this in a more modern language.) But if someone can give me a syntax that works under gcc, I'll accept that as solution to the problem. Caitlin
If I understand correctly, then "t-> xthing" should be the pointer to the XUNDO2 structure. My knowledge of C is getting a bit rusty, but inserting a pair of parentheses should help, then: Code: Select all{if ((struct XUNDO2*)(t-> xthing)-> xnewstep[s] != 0) break;};
Hi Folks!! New here but old in Linux, first of all, as by rules, I searched for my question without find something similar so I'm opening this new thread hoping in some suggestion/help: I'd like to create a bash script that I launch as normal user, ask me root password and if it's correct execute: apt update && apt upgrade && apt autoremove. I tried different ways but unsuccesfully! Ex I tried: $ gedit update.bash Code: Select all#!bin/bash sudo root apt update && apt upgrade && apt autoremove # chmod +x update.bash or I also tried: Code: Select all#!bin/bash su - && update && apt upgrade && apt autoremove exit Please, any suggestion/help? Thank you so much!!
Have to installed sudo and added yourself to the sudo list?
System: Bullseye, Code: Select all5.7.0-2-amd64 #1 SMP Debian 5.7.10-1 (2020-07-26) x86_64 GNU/Linux Tortoisehg downloaded from: https://www.mercurial-scm.org/ error message when running thg: Code: Select allTraceback (most recent call last): File "./thg", line 52, in <module> from setup import build_ui File "~/DATA0/Software_Dev/TortoiseHg/thg new/setup.py", line 30, in <module> from i18n.msgfmt import Msgfmt File "~/DATA0/Software_Dev/TortoiseHg/thg new/i18n/msgfmt.py", line 39, in <module> from mercurial import ( ImportError: No module named mercurial other config data: Code: Select allwhich python /usr/bin/python hg --version gives Mercurial Distributed SCM (version 5.4.1) python --version gives Python 2.7.18 usr/bin/python points to python2, which points to python2.7 usr/bin/python3 points to python3.8 pyversions -i gives python2.7 Directories present / not present: /usr/lib/python3/dist-packages/mercurial /usr/lib/python2.7/dist-packages/ : no mercurial folder! /usr/lib/python3.8/ : no dist-packages folder! I think the problem is that the system is running python 2.7 but the corresponding usr/lib/python2.7 folder does not have mercurial in it. So I added this to my .bashrc: Code: Select allalias python='/usr/bin/python3' But now python --version gives Python 3.8.5 and the python 3.8 libs also don't have mercurial in them, and I get the same error. How do I fix this?
ticketman wrote:Bullseye Why not just use the stable release instead? That has tortoisehg in the repositories. ticketman wrote:Code: Select allImportError: No module named mercurial Code: Select all# apt install mercurial
Sorry, for asking such a probably very trivial question but I am stuck and so far I am unable to find an answer. I want to apply a patch to a free cpp project I am helping out with as a designer. Somebody provided a .patch file and I expected it would be easy to just do: "$ patch < file.patch" if I am in the right folder on Debian stable. But I get "bash: patch: command not found" as a result and I can't find "patch" as a package in Debian either. So far I was unable to find any hint how I could actually use the patch command on Debian. Everywhere it just seems to be assumed that the patch command works out of the box. Obviously I am missing something here. Can anyone enlighten me?
The "patch" command is provided by the "patch" package. Are your package sources configured properly ? Code: Select allapt-cache policy patch
I am not so good in bash, so I have simple question. I have some music in ALAC (m4a) files, distributed in sub directories (albums). I want to convert them in FLAC. I am trying something like this: Code: Select allfor i in */*.m4a; do ffmpeg -i "$i" ${i%m4a}wav; done to convert them in WAV format, but expansion */*.m4a is not working, I get the error message from ffmpeg that */*.m4a does not exist. How to solve the problem with expansion?
You should use find to navigate through subdirectories. However, there is a very good Bash script out there for converting various sound files to flac: https://www.legroom.net/software/convtoflac I suggest you download it and study it. It's safe to use, by the way: I use it almost daily.
Hi, Do you know How do i get this: rsync --delete --max-size=20M /source /target this, only works once.. when i update max-size, delete option doesnt purge target files bigger or smaller than "max-size"... Its very strange, it obligates me to delete all target files before i want to sync filtering by size file in order to work properly .. Right now, I have it this way working like I would like it..(I had to use hardlinks to prevent all files being copying each time, cos I need a first delete.) Code: Select allrm -R "$pathvideoshort/"* rsync -av --delete --max-size=12M --link-dest="$pathvideos/" "$pathvideos/" "$pathvideoshort/" Thanks a lot.
Do you believe that --delete affects --max-size? Please read, and try to understand, the fine rsync manual. Code: Select allman rsync