Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


dspln last won the day on July 21 2013

dspln had the most liked content!

Community Reputation

0 Neutral

About dspln

  • Rank
  1. I think the functions I need are in libkdeui.so, but they are C++ mangled, so a helper.so that does extern "C" is needed. This works, there is some voodoo I don't understand (QApplication a(n,c) must initialize a global, because I get a seg fault without it) /* this is vwkde.c make sure the next line's vars are set correctly, then execute to create vwkde.so KDEDIR=/usr/kde/3.5; QTDIR=/usr/qt/3 g++ -c -I$KDEDIR/include -I$QTDIR/include -Wall -fPIC vwkde.c && gcc -shared -Wl,-soname,vwkde.so -o vwkde.so vwkde.o */ #include <kwin.h> #include <qapplication.h> char **c; int n =0; QApplication a( n, c); extern "C" int setCurrentDesktop(int i) { KWin::setCurrentDesktop(i); return i; } extern "C" int setOnDesktop(int w, int d) { KWin::setOnDesktop(w,d); return w; } extern "C" int setOnAllDesktops(int w, int d) { KWin::setOnAllDesktops(w,d); return w; } extern "C" int numberOfDesktops() { return KWin::numberOfDesktops(); } extern "C" int currentDesktop() { return KWin::currentDesktop(); } These links were helpful: http://api.kde.org/cvs-api/kdelibs-apidocs...ssKWin.html#e24 http://www.yolinux.com/TUTORIALS/LibraryAr...AndDynamic.html http://developer.kde.org/documentation/tutorials/index.html
  2. dspln

    Gentoo Installation

    Nice - spread the gentoo love . If you have another computer, I'd recommend doing a remote install - that way you can browse docs, etc while doing the install. boot as described. Once you get the prompt, #net-setup eth0 set the ip and stuff so you can get to it. #passwd set the root password #/etc/init.d/sshd start start the sshd demon. now you can continue the installation from the other machine using ssh (from linux) or putty (from windows) forums.gentoo.org is also a great place to get quick help
  3. Well, I got a little further: /usr/lib/X11/include has a pile of .h files, which I guess get built into libX11.so - maybe, but there is no libX11.h. /usr/kde/3.4/lib has kde .so files, and /usr/kde/3.4/include has the .h files
  4. Interesting, but not what I needed. I guess I figure that .so (shared object?) are the unix equivalent of windows' .dll (dynamic link library). most (or all) windows .dll files have an corresponding .h (header) file detailing what is exported (functions that can be called), and how to use them (what it returns, what the arguments are). Where is that info for unix .so files? slocate doesn't turn up .h files for libc.so - and yet my running smalltalk (Visualworks 7.4) uses one of ('libc.so' 'libc.sl' 'libc.a(shr.o)') - so it does work. For example: void openlog(char * ident, int option, int facility) I can call this and add to the system log using it and a few other functions. Sooo, I am looking for a list of useful system/gui functions and what .so they can be found in. A website would be great - I used microsoft.com/win32api... all the time when writing the win32 api calls. the info for openlog: misc/sys/syslog.h:extern void openlog (__const char *__ident, int __option, int __facility); for chdir: posix/unistd.h:extern int chdir (__const char *__path) __THROW __nonnull ((1));
  5. I am moving a non-C app (smalltalk) from windows to linux. Windows has win32 api functions for a lot of things - in particular, window management. For example, if I have a window's handle, I can SetWindowPos, FlashWindow, GetWindowText, etc. To get all window handles: EnumWindows Currently I am trying to figure out how to move windows (programatically) to a specific desktop, and to determine the available desktop size (window size when maximized: the screen size - kicker panels). In smalltalk, accessing the win32 api's is done by loading a dll ('user32.dll' 'kernel32.dll' 'winmm.dll' 'gdi32.dll' 'psapi.dll' 'advapi32.dll' 'ole32.dll'), then calling the exported function. Smalltalk provides similar for linux - the 'oracle connect' use 'libclntsh.so'. What is the general way to do these types of things in KDE/X Any web sites you can recommend? developer.kde.org didn't really help, but then again, I don't really know what to look for I think maybe libkdeui.so may have what I am looking for, but I didn't see any libkdeui.h - wth?
  6. dspln

    batch file noob

    AFAIK, what you posted will let you execute remote programs on the local computer - not what you want. To just shutdown/reboot a computer I guess you could use shutdown E:\>shutdown /? Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) I used to use rcmd (from NT Resource kit) for arbitrary remote commands: E:\bin\NTRESKIT>rcmd /? Usage: rcmd [server_name [command] ] Prompts for server_name if not supplied. Session is interactive and is terminated by ctrl-Break or Exit of remote shell. Program is terminated by ctrl-Break or ctrl-C when no session is in progress. If no command supplied, session is interactive and is terminated by ctrl-Break or Exit of remote cmd shell If command is supplied, remote shell executes single command on specified server and exits. Note : Command line server_name requires leading '\\'s
  7. I tried installing SpaceRangers2 DVD using cedega, but it will not start, I assume because of the StarForce dvd protection. I found a no-cd crack for it on the interweb, but I am concerned about viruses. Is running a potential-virus under cedega/wine less risky than in windows? Anyone know where I can find a list of md5/sha1 for virus free cracks (rangers.exe in this case).
  8. ComputerA has a usb drive /dev/sdc1 - either fat32 or ntfs. I mount it as /dev/sdc1 on /ext/c1 type ntfs (rw,nosuid,nodev,umask=000) all user on ComputerA can access it. My /etc/exports has: /ext,no_subtree_check,rw) ComputerB has mounted: ComputerA:/ext on /ext type nfs (rw,nosuid,nodev,addr= no one on B can see files in /ext/c1 - it is like nfs isn't aware that a drive is mounted on 'c1'. How do I provide nfs access to these usb/firewire drives? The man page for exports mentions the nohide option, which makes it work for one client - but this did not work for me. I guess I'll try a share for each drive I figured nfs would abstract the file system types out of it. Maybe samba is a better choice?
  9. I couldn't get this working on gentoo. I am currently following the instructions on gentoo-wiki.com. Just got it working :)! What a difference from the normal slow slow cpu-eater! Thanks!
  10. I've got iptables (with just about all the options) built into the kernel. I clear the firewall: iptables -F iptables -t nat -F iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT (On the firewall/router) I start iptraf, then start irssi, /connect dalnet, all that happens in iptraf is: ┌{eth1ip}:60267 = 3 180 S--- eth1 └{dalnet}:6667 = 0 0 ---- eth1 eth1 is the internet connected nic. midentd is listening on 113 I've tried using a client on my home network, but it doesn't make it through the router either. In an iptables config file here I noticed: IRCPORTS="6665,6666,6667,6668,6669,7000" #IRC Ports ... /sbin/modprobe ip_conntrack_irc ports=$IRCPORTS /sbin/modprobe ip_nat_irc ports=$IRCPORTS But I have those modules built into the kernel - do they need those parameters, and how do I pass them if I don't have the modules? Or do these not work if built into the kernel? Gentoo 2005.1 i386 Otherwise, firewall/router seems to work fine - I can access http on on the router, and http/ssh/ftp/counter-strike all get thru the router just fine.
  11. I know windows, programming and databases well, but next to nothing about linux. I tried debian, slackware, suse and redhat before I tried gentoo. The gentoo install was alot more involved than the others, but at the end of it I felt like I knew what the hell was going on, and there are lots of great how-to's for gentoo. So yeah, I love it.
  12. before I learned of netstat, I started using lsof -i -n -P seems to give a bit more info (or just lsof to get a dump of all open files - long list )
  13. dspln

    Using Screen

    Screen is a life saver. Before I learned of it, I thought "how in the world do people get anything done without X-windows !?!" Nice tip about hardstatus - I really need to read the man pages more
  14. My server had been up for 3 days before this got logged: I did exactly as you did, including switching to rsa after I read the warning in Putty I also use Putty Authentication Agent (PAGEANT.EXE) - to avoid retyping passphrases. The one problem I have with sshd is, I changed it to run on a different port (6022), and ssh works fine, but sftp won't connect. Anyone know why this might be? I also allow only my homeip to connect: iptables -I INPUT -s ${homeip} -p TCP --dport 6022 -j ACCEPT My home ip is DHCP, but it only changes when I change the router (like switching from a Linksys home router to a gentoo homebuilt router ). So in case my ip does change again, I added port knock to the server to allow the new address in /etc/knockd.conf [options] logfile = /var/log/knockd.log [openMain] sequence = 7000,8000,9000 seq_timeout = 15 command = /usr/util/knockset.sh open %IP% tcpflags = syn [closeMain] sequence = 9000,800,7000 seq_timeout = 15 command = /usr/util/knockset.sh close %IP% tcpflags = syn /usr/util/knockset.sh #!/bin/bash #knockset.sh called from /etc/knock.conf ports="8888 pop3s imaps https http domain smtp 6022" ip=$2 doports () { for p in $ports; do iptables -$IorD INPUT -s $ip -p TCP --dport $p -j ACCEPT done iptables -$IorD INPUT -s $ip -p UDP --dport domain -j ACCEPT iptables -$IorD INPUT -s $ip -p icmp -j ACCEPT } open() { IorD="I" doports } close() { IorD="D" doports } case $1 in open) open;; close) close;; [?]) print >&2 "Usage $0 [open] [close] ip.address.to.change" exit;; esac
  • Create New...