Search Results

Search found 4 results on 1 pages for 'drtwox'.

Page 1/1 | 1 

  • How do I change the Dropbox directory on a headless GNU/Linux server?

    - by DrTwox
    I have installed Dropbox 2.0.0 via command line on my home server (Ubuntu Server 12.04) to use for off-site automated backups, but I can't change the directory that the Dropbox daemon keeps synced. I've tried the following: The official docs say to use the desktop application, which is not applicable in my situation. However I installed the desktop app on my desktop machine and changed the default folder location, but I can't find where this change is stored in the ~/.dropbox/ directory so I can make the same change on the server. This page (and several others) recommends a Python script to do the job. Looking at the script, it opens a SQLite database called ~/.dropbox/dropbox.db, which does not exist on my Dropbox install, leading me to believe the script is out-of-date. This forum thread suggests manually inserting the required row in the config.db database, which I did, but it made no difference. I checked the same database file on my desktop machine, and it does not have the dropbox_path key, so I'm presuming the information in that thread is also out of date for version 2.0. I have tried to launch the Dropbox GUI configuration wizard over SSH with X11 forwarding, as suggested in one of the answers, but the binary must detect the absence of a local X11 install and it starts a command line daemon instead, which provides no means to change the option I need. I am currently using a symlink, as suggested as an answer, but this is a kludge. I would like to know the correct way to make the change. How do I change the Dropbox directory on a headless GNU/Linux server? Update: I've ditched Dropbox and started using Copy. Their Linux tools and support is far superior to Dropbox. I leave this question here in case someone, someday, can answer it.

    Read the article

  • How to initialize an array of structures within a function?

    - by drtwox
    In the make_quad() function below, how do I set the default values for the vertex_color array in the quad_t structure? /* RGBA color */ typedef { uint8_t r,g,b,a; } rgba_t; /* Quad polygon - other members removed */ typedef { rgba_t vertex_color[ 4 ] } quad_t; Elsewhere, a function to make and init a quad: quad_t *make_quad() { quad_t *quad = malloc( sizeof( quad_t ) ); quad->vertex_color = ??? /* What goes here? */ return ( quad ); } Obviously I can do it like this: quad->vertex_color[ 0 ] = { 0xFF, 0xFF, 0xFF, 0xFF }; ... quad->vertex_color[ 3 ] = { 0xFF, 0xFF, 0xFF, 0xFF }; but this: quad->vertex_color = { { 0xFF, 0xFF, 0xFF, 0xFF }, { 0xFF, 0xFF, 0xFF, 0xFF }, { 0xFF, 0xFF, 0xFF, 0xFF }, { 0xFF, 0xFF, 0xFF, 0xFF } }; ...results in "error: expected expression before '{' token".

    Read the article

  • Self referencing userdata and garbage collection

    - by drtwox
    Because my userdata objects reference themselves, I need to delete and nil a variable for the garbage collector to work. Lua code: obj = object:new() -- -- Some time later obj:delete() -- Removes the self reference obj = nil -- Ready for collection C Code: typedef struct { int self; // Reference to the object // Other members and function references removed } Object; // Called from Lua to create a new object static int object_new( lua_State *L ) { Object *obj = lua_newuserdata( L, sizeof( Object ) ); // Create the 'self' reference, userdata is on the stack top obj->self = luaL_ref( L, LUA_REGISTRYINDEX ); // Put the userdata back on the stack before returning lua_rawgeti( L, LUA_REGISTRYINDEX, obj->self ); // The object pointer is also stored outside of Lua for processing in C return 1; } // Called by Lua to delete an object static int object_delete( lua_State *L ) { Object *obj = lua_touserdata( L, 1 ); // Remove the objects self reference luaL_unref( L, LUA_REGISTRYINDEX, obj->self ); return 0; } Is there some way I can set the object to nil in Lua, and have the delete() method called automatically? Alternatively, can the delete method nil all variables that reference the object? Can the self reference be made 'weak'?

    Read the article

  • How can I find a URL called [link] inside a block of HTML containing other URLs?

    - by DrTwox
    I'm writing a script to rewrite Reddit's RSS feeds. The script needs to find a URL named [link] inside a block of HTML that contains other URLs. The HTML is contained in an XML element called <description>. Here are two examples of the <description> element from I need to parse and the [link] I would need to get. First example: <description>submitted by &lt;a href=&#34;http://www.reddit.com/user/wildlyinaccurate&#34;&gt; wildlyinaccurate &lt;/a&gt; &lt;br/&gt; &lt;a href=&#34;http://wildlyinaccurate.com/a-hackers-guide-to-git&#34;&gt;[link]&lt;/a&gt; &lt;a href="http://www.reddit.com/r/programming/comments/26jvl7/a_hackers_guide_to_git/"&gt;[66 comments]&lt;/a&gt;</description> The [link] is: http://wildlyinaccurate.com/a-hackers-guide-to-git Second example: <description>&lt;!-- SC_OFF --&gt;&lt;div class=&#34;md&#34;&gt;&lt;p&gt;I work a support role at a company where I primarily fix issues our customers our experiencing with our software, which is a browser based application written primarily in javascript. I&amp;#39;ve been doing this for 2 years, but I want to take it to the next level (with the long term goal being that I become proficient enough to call myself a developer). I&amp;#39;ve been reading &amp;quot;Javascript The Definitive Guide&amp;quot; by O&amp;#39;Reilly but I was wondering if any of you more experienced users out there had some tips on taking it to the next level. Should I start incorporating some PHP and Jquery into my learning? Side projects on my spare time? Any good online resources? Etc. &lt;/p&gt; &lt;p&gt;Thanks! &lt;/p&gt; &lt;/div&gt;&lt;!-- SC_ON --&gt; submitted by &lt;a href=&#34;http://www.reddit.com/user/56killa&#34;&gt; 56killa &lt;/a&gt; &lt;br/&gt; &lt;a href=&#34;http://www.reddit.com/r/javascript/comments/26nduc/i_want_to_become_more_experienced_with_javascript/&#34;&gt;[link]&lt;/a&gt; &lt;a href="http://www.reddit.com/r/javascript/comments/26nduc/i_want_to_become_more_experienced_with_javascript/"&gt;[4 comments]&lt;/a&gt;</description> The [link] is: http://www.reddit.com/r/javascript/comments/26nduc/i_want_to_become_more_experienced_with_javascript/

    Read the article

1