Having trouble starting a gnome session over ssh
I have a headless box running 12.04 and I want to pipe a gnome session
over x11. I connect via ssh -X -l name -p port 192.168.1.14, then run
gnome-session
This prints out without opening a window:
GNOME_KEYRING_CONTROL=/tmp/keyring-5cLMRd
SSH_AUTH_SOCK=/tmp/keyring-5cLMRd/ssh
GNOME_KEYRING_PID=2534
GNOME_KEYRING_CONTROL=/tmp/keyring-5cLMRd
SSH_AUTH_SOCK=/tmp/keyring-5cLMRd/ssh
GPG_AGENT_INFO=/tmp/keyring-5cLMRd/gpg:0:1
GNOME_KEYRING_CONTROL=/tmp/keyring-5cLMRd
SSH_AUTH_SOCK=/tmp/keyring-5cLMRd/ssh
GPG_AGENT_INFO=/tmp/keyring-5cLMRd/gpg:0:1
GNOME_KEYRING_CONTROL=/tmp/keyring-5cLMRd
SSH_AUTH_SOCK=/tmp/keyring-5cLMRd/ssh
GPG_AGENT_INFO=/tmp/keyring-5cLMRd/gpg:0:1
** (gnome-settings-daemon:2537): WARNING **: You can only run one
xsettings manager at a time; exiting
** (gnome-settings-daemon:2537): WARNING **: Unable to start xsettings
manager: Could not initialize xsettings manager.
[1380764298,000,xklavier.c:xkl_engine_start_listen/] The backend does
not require manual layout management - but it is provided by the
application
compiz (core) - Error: Screen 0 on display "localhost:10.0" already has a
window manager; try using the --replace option to replace the current
window manager.
(bluetooth-applet:2549): Bluetooth-WARNING **: Could not open RFKILL
control device, please verify your installation
Initializing nautilus-gdu extension
** (nm-applet:2551): WARNING **: Could not initialize NMClient
/org/freedesktop/NetworkManager: Rejected send message, 2 matched rules;
type="method_call", sender=":1.98" (uid=1000 pid=2551 comm="nm-applet ")
interface="org.freedesktop.DBus.Properties" member="GetAll" error
name="(unset)" requested_reply="0"
destination="org.freedesktop.NetworkManager" (uid=0 pid=872
comm="NetworkManager ")
** Message: applet now removed from the notification area
** Message: using fallback from indicator to GtkStatusIcon
(gnome-settings-daemon:2537): keyboard-plugin-WARNING **: Failed to set
the keyboard layouts:
GDBus.Error:org.freedesktop.Accounts.Error.PermissionDenied: Not
authorized
** (gnome-settings-daemon:2537): WARNING **: Failed to connect context:
Connection refused
(gnome-settings-daemon:2537): clipboard-plugin-WARNING **: Clipboard
manager is already running.
(gnome-settings-daemon:2537): color-plugin-WARNING **: failed to get edid:
unable to get EDID for output
(gnome-settings-daemon:2537): color-plugin-WARNING **: failed to create
device: GDBus.Error:org.freedesktop.ColorManager.Failed: failed to obtain
org.freedesktop.color-manager.create-device auth
(gnome-settings-daemon:2537): color-plugin-WARNING **:
GDBus.Error:org.freedesktop.ColorManager.Failed: failed to obtain
org.freedesktop.color-manager.create-profile auth
Shutting down nautilus-gdu extension
** (gnome-settings-daemon:2537): WARNING **: Failed to connect context:
Connection refused
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
** (update-notifier:2635): WARNING **: already running?
I'm not really sure where to go from here, all solutions I've found were
in regards to weird edge cases that don't apply to me.
Wednesday, 2 October 2013
does inherited class can access base class
does inherited class can access base class
If I have ThumbPhoto entity which inherits Photo entity and Photo entity
inherits Entity<int> is it enough to use
public class ThumbnailPhoto : Photo
or should I use
public class ThumbnailPhoto : Photo, Entity<int>
If I have ThumbPhoto entity which inherits Photo entity and Photo entity
inherits Entity<int> is it enough to use
public class ThumbnailPhoto : Photo
or should I use
public class ThumbnailPhoto : Photo, Entity<int>
phpspec. checking key for array
phpspec. checking key for array
Exist some class:
class A{
protected $options;
public function setDefaults($defaults){
$this->options=$defaults;
}
public function getOptions(){
return $this->options;
}
}
And other class:
class B{
public function setDefaultOptions(A $options){
$options->setDefaults('foo'=>'bar')
}
}
Uses:
$a=new A();
$b=new B();
$b->setDefaultsOptions(a);
How I can check in spec for B that $a->options['foo'] is set?
Exist some class:
class A{
protected $options;
public function setDefaults($defaults){
$this->options=$defaults;
}
public function getOptions(){
return $this->options;
}
}
And other class:
class B{
public function setDefaultOptions(A $options){
$options->setDefaults('foo'=>'bar')
}
}
Uses:
$a=new A();
$b=new B();
$b->setDefaultsOptions(a);
How I can check in spec for B that $a->options['foo'] is set?
#EANF#
#EANF#
am just a newbie in PHP and i am trying to create a forgot password
function i do have this following code
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inventory", $con);
$a=$_POST['password'];
$b=$_POST['newpassword'];
$c=$_POST['retypepassword'];
$result = mysql_query("SELECT * from admins " );
while($row = mysql_fetch_array($result))
{
$password = $row['password'] ;
}
if($_POST['retypepassword'] != $b){
echo "<script type='text/javascript'>alert('Password Not
match');
window.location.href='forgotpass.php?id=0';
</script>";
exit();
}
if($_POST['password'] != $password){
echo "<script type='text/javascript'>alert('You
Provide wrong Password');
window.location.href='forgotpass.php?id=0';
</script>";
exit();
}
else {
mysql_query("UPDATE admins SET password = '$b'
WHERE password = '$a' ");
header("location: index.php?id=0");
};
?>
now, the problem is i can only update the last account inserted in
database. let say for example i have this following account from my
database, and i would like to change "greeg" there is no any problem with
this. BUT if i change "gejel" ("first value in database") it show me this
"You Provide wrong Password" i don't know why i always get here. i guess
there is something wrong with "WHERE" ? pls help help help me :D
id |password |
1 | gejel |
2 | greeg |
am just a newbie in PHP and i am trying to create a forgot password
function i do have this following code
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inventory", $con);
$a=$_POST['password'];
$b=$_POST['newpassword'];
$c=$_POST['retypepassword'];
$result = mysql_query("SELECT * from admins " );
while($row = mysql_fetch_array($result))
{
$password = $row['password'] ;
}
if($_POST['retypepassword'] != $b){
echo "<script type='text/javascript'>alert('Password Not
match');
window.location.href='forgotpass.php?id=0';
</script>";
exit();
}
if($_POST['password'] != $password){
echo "<script type='text/javascript'>alert('You
Provide wrong Password');
window.location.href='forgotpass.php?id=0';
</script>";
exit();
}
else {
mysql_query("UPDATE admins SET password = '$b'
WHERE password = '$a' ");
header("location: index.php?id=0");
};
?>
now, the problem is i can only update the last account inserted in
database. let say for example i have this following account from my
database, and i would like to change "greeg" there is no any problem with
this. BUT if i change "gejel" ("first value in database") it show me this
"You Provide wrong Password" i don't know why i always get here. i guess
there is something wrong with "WHERE" ? pls help help help me :D
id |password |
1 | gejel |
2 | greeg |
Tuesday, 1 October 2013
how to automatically run a macro at a given hour
how to automatically run a macro at a given hour
I'm wondering if anyone here has experience with setting up a macro to run
automatically at a given time... lets say 5AM.
There are some posts on mr excel but most of what I find is simply OnTime
"x time" based code, and I'm unsure how this executes.
Do you have to open the sheet, run the macro and then expect it to run at
the given time? Once it is open, will it run every day at that time or can
you run it whenever?
I'm wondering if anyone here has experience with setting up a macro to run
automatically at a given time... lets say 5AM.
There are some posts on mr excel but most of what I find is simply OnTime
"x time" based code, and I'm unsure how this executes.
Do you have to open the sheet, run the macro and then expect it to run at
the given time? Once it is open, will it run every day at that time or can
you run it whenever?
Adding a legend to PyPlot in Matplotlib
Adding a legend to PyPlot in Matplotlib
TL;DR -> How can one create a legend for a line graph in Matplotlib's
PyPlot without creating any extra variables?
Please consider the graphing script below:
if __name__ == '__main__':
PyPlot.plot(total_lengths, sort_times_bubble, 'b-',
total_lengths, sort_times_ins, 'r-',
total_lengths, sort_times_merge_r, 'g+',
total_lengths, sort_times_merge_i, 'p-', )
PyPlot.title("Combined Statistics")
PyPlot.xlabel("Length of list (number)")
PyPlot.ylabel("Time taken (seconds)")
PyPlot.show()
As you can see, this is a very basic use of matplotlib's PyPlot. This
ideally generates a graph like the one below:
Nothing special, I know. However, it is unclear as to what data is being
plotted where (I'm trying to plot the data of some sorting algorithms,
length against time taken, and I'd like to make sure people know which
line is which). Thus, I need a legend, however, taking a look at the
following example below(from the official site):
ax = subplot(1,1,1)
p1, = ax.plot([1,2,3], label="line 1")
p2, = ax.plot([3,2,1], label="line 2")
p3, = ax.plot([2,3,1], label="line 3")
handles, labels = ax.get_legend_handles_labels()
# reverse the order
ax.legend(handles[::-1], labels[::-1])
# or sort them by labels
import operator
hl = sorted(zip(handles, labels),
key=operator.itemgetter(1))
handles2, labels2 = zip(*hl)
ax.legend(handles2, labels2)
You will see that I need to create an extra variable ax. How can I add a
legend to my graph without having to create this extra variable and
retaining the simplicity of my current script.
TL;DR -> How can one create a legend for a line graph in Matplotlib's
PyPlot without creating any extra variables?
Please consider the graphing script below:
if __name__ == '__main__':
PyPlot.plot(total_lengths, sort_times_bubble, 'b-',
total_lengths, sort_times_ins, 'r-',
total_lengths, sort_times_merge_r, 'g+',
total_lengths, sort_times_merge_i, 'p-', )
PyPlot.title("Combined Statistics")
PyPlot.xlabel("Length of list (number)")
PyPlot.ylabel("Time taken (seconds)")
PyPlot.show()
As you can see, this is a very basic use of matplotlib's PyPlot. This
ideally generates a graph like the one below:
Nothing special, I know. However, it is unclear as to what data is being
plotted where (I'm trying to plot the data of some sorting algorithms,
length against time taken, and I'd like to make sure people know which
line is which). Thus, I need a legend, however, taking a look at the
following example below(from the official site):
ax = subplot(1,1,1)
p1, = ax.plot([1,2,3], label="line 1")
p2, = ax.plot([3,2,1], label="line 2")
p3, = ax.plot([2,3,1], label="line 3")
handles, labels = ax.get_legend_handles_labels()
# reverse the order
ax.legend(handles[::-1], labels[::-1])
# or sort them by labels
import operator
hl = sorted(zip(handles, labels),
key=operator.itemgetter(1))
handles2, labels2 = zip(*hl)
ax.legend(handles2, labels2)
You will see that I need to create an extra variable ax. How can I add a
legend to my graph without having to create this extra variable and
retaining the simplicity of my current script.
Representing a strange number as a fraction
Representing a strange number as a fraction
Can this decimal with special patterns be expressed as a fraction? Is it a
rational number?
$$0.101001000100001000001...$$
Where the number of zeros after every 1 is increased by 1.
Ty.
Can this decimal with special patterns be expressed as a fraction? Is it a
rational number?
$$0.101001000100001000001...$$
Where the number of zeros after every 1 is increased by 1.
Ty.
Copy latest created directory
Copy latest created directory
I would like to make a second backup from the latest created backup. So I
tried the shell command:
last='ls -tr | tail -1'
cp -r /path/.../"$last" /path/.../backup/
but it copies a randome backup.
It is working perfect with .zip and .tar files but not with folders as I
need it here.
I googled for a solution but couldn´t find anything related to this, I
hope you can help me.
It would also be possible to use the name of directory which is for example:
2013-09-27-05-22-45
I would like to make a second backup from the latest created backup. So I
tried the shell command:
last='ls -tr | tail -1'
cp -r /path/.../"$last" /path/.../backup/
but it copies a randome backup.
It is working perfect with .zip and .tar files but not with folders as I
need it here.
I googled for a solution but couldn´t find anything related to this, I
hope you can help me.
It would also be possible to use the name of directory which is for example:
2013-09-27-05-22-45
Subscribe to:
Comments (Atom)